bugGNU Octave - Bugs: bug #57176, [octave forge] (io) csv2cell...

 
 

bug #57176: [octave forge] (io) csv2cell segfaults with 64bit indexes (called from tblread function test)

Submitted by:  Orion Poplawski <opoplawski>
Submitted on:  Wed 06 Nov 2019 04:40:06 AM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Invalid Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  5.1.0 Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 08 Nov 2019 08:07:36 AM UTC, comment #5: 

Thanks.
But doesn't that only run the .m file tests? "runtest" only seems to apply to the .../share/... package dirs.
What I was referring to is the .oct file tests for binary modules in the <OCTAVE_HOME>/lib/ subdirs.

I was wondering if there's a way to automatically extract BIST tests from .cc files and put them somewhere in a /test subdir in in the installed .m file subdir. But that'll only seems to work if they're made into .m files, not s/th like csv2cell.cc-tst.
But I'll ask in the maintainers ML.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 08 Nov 2019 12:48:39 AM UTC, comment #4: 

Tests are run during the package rpm build with:

octave -H -q --no-window-system --no-site-file --eval 'pkg("prefix","/builddir/build/BUILDROOT/octave-statistics-1.4.1-4.fc32.x86_64/usr/share/octave/packages","/builddir/build/BUILDROOT/octave-statistics-1.4.1-4.fc32.x86_64/usr/lib64/octave/packages");pkg("local_list",fullfile("/builddir/build/BUILDROOT/octave-statistics-1.4.1-4.fc32.x86_64/usr/share/octave","octave_packages"));pkg("list");pkg("install","-verbose",glob("/builddir/build/BUILD/octave-statistics-1.4.1/build/statistics-1.4.1-*.tar.gz"){1,1});pkg("load","statistics");pkg("list");runtests("/builddir/build/BUILDROOT/octave-statistics-1.4.1-4.fc32.x86_64/usr/share/octave/packages/statistics-1.4.1");unlink(pkg("local_list"));'

So the /builddir/... path contains the built package which is installed, loaded, and then tests run.  The pre-built octave-io package is also installed.  The problem I had is that I hadn't rebuilt octave-io first with 64bit indexes.

Orion Poplawski <opoplawski>
Thu 07 Nov 2019 08:35:04 PM UTC, comment #3: 

@Orion:
Do you run the csv2cell BIST tests?
After the io package has been built & installed the source file csv2cell.cc is inaccessible so these tests can't be run. That's why I'm wondering how you run the tests you mention in comment #2.

Philip Nienhuis <philipnienhuis>
Project Member
Thu 07 Nov 2019 03:51:55 AM UTC, comment #2: 

So, obviously the octave packages need to be rebuilt with the 64bit indexes version of octave.  After rebuilding octave-io, the tests run fine.  This can be closed.

Orion Poplawski <opoplawski>
Wed 06 Nov 2019 05:23:53 PM UTC, comment #1: 

The call stack in the valgrind report looks like this is actually in the io package function 'csv2cell', reassigning.

Mike Miller <mtmiller>
Project Administrator
Wed 06 Nov 2019 04:40:06 AM UTC, original submission:  

We recently enabled 64bit indexes in the Fedora octave package in rawhide (as well as LTO optimization).  Now the statistics package  tblread test is failing.  valgrind reports:

  tblread.m ...................................................==192290== Conditional jump or move depends on uninitialised value(s)
==192290==    at 0x535BBC5: octave_matrix::try_narrowing_conversion() (ov-re-mat.cc:110)
==192290==    by 0x5331BF4: octave_value::maybe_mutate() (ov.cc:1137)
==192290==    by 0x53389AC: octave_value::octave_value(Matrix const&, MatrixType const&) (ov.cc:539)
==192290==    by 0x2AB0A955: Fcsv2cell(octave_value_list const&, int) (in /usr/lib64/octave/packages/io-2.4.13/x86_64-redhat-linux-gnu-api-v53/csv2cell.oct)
==192290==    by 0x5415AF1: octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-builtin.cc:65)
==192290==    by 0x52BCDA9: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (pt-eval.cc:2008)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B7A09: octave::tree_evaluator::visit_simple_assignment(octave::tree_simple_assignment&) (pt-eval.cc:2681)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B8DCC: octave::tree_evaluator::visit_statement(octave::tree_statement&) (pt-eval.cc:2776)
==192290==    by 0x52B2903: octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) (pt-stmt.h:119)
==192290==    by 0x52C06CC: octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) (pt-stmt.h:194)
==192290==
==192290== Invalid read of size 8
==192290==    at 0x6387748: dim_vector::safe_numel() const (dim-vector.cc:111)
==192290==    by 0x2AB0A9BA: Fcsv2cell(octave_value_list const&, int) (in /usr/lib64/octave/packages/io-2.4.13/x86_64-redhat-linux-gnu-api-v53/csv2cell.oct)
==192290==    by 0x5415AF1: octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-builtin.cc:65)
==192290==    by 0x52BCDA9: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (pt-eval.cc:2008)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B7A09: octave::tree_evaluator::visit_simple_assignment(octave::tree_simple_assignment&) (pt-eval.cc:2681)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B8DCC: octave::tree_evaluator::visit_statement(octave::tree_statement&) (pt-eval.cc:2776)
==192290==    by 0x52B2903: octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) (pt-stmt.h:119)
==192290==    by 0x52C06CC: octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) (pt-stmt.h:194)
==192290==    by 0x533DF06: octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-usr-fcn.cc:455)
==192290==    by 0x52BCDA9: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (pt-eval.cc:2008)
==192290==  Address 0xff546c0 is 0 bytes after a block of size 16 alloc'd
==192290==    at 0x483A593: operator new[](unsigned long) (vg_replace_malloc.c:433)
==192290==    by 0x2AB0A95F: Fcsv2cell(octave_value_list const&, int) (in /usr/lib64/octave/packages/io-2.4.13/x86_64-redhat-linux-gnu-api-v53/csv2cell.oct)
==192290==    by 0x5415AF1: octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-builtin.cc:65)
==192290==    by 0x52BCDA9: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (pt-eval.cc:2008)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B7A09: octave::tree_evaluator::visit_simple_assignment(octave::tree_simple_assignment&) (pt-eval.cc:2681)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B8DCC: octave::tree_evaluator::visit_statement(octave::tree_statement&) (pt-eval.cc:2776)
==192290==    by 0x52B2903: octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) (pt-stmt.h:119)
==192290==    by 0x52C06CC: octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) (pt-stmt.h:194)
==192290==    by 0x533DF06: octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-usr-fcn.cc:455)
==192290==    by 0x52BCDA9: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (pt-eval.cc:2008)
==192290==
==192290== Invalid free() / delete / delete[] / realloc()
==192290==    at 0x483B0D6: operator delete(void*, unsigned long) (vg_replace_malloc.c:595)
==192290==    by 0x2AB0C0E9: Array<double>::~Array() (in /usr/lib64/octave/packages/io-2.4.13/x86_64-redhat-linux-gnu-api-v53/csv2cell.oct)
==192290==    by 0x2AB08DB1: ??? (in /usr/lib64/octave/packages/io-2.4.13/x86_64-redhat-linux-gnu-api-v53/csv2cell.oct)
==192290==    by 0x5415AF1: octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-builtin.cc:65)
==192290==    by 0x52BCDA9: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (pt-eval.cc:2008)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B7A09: octave::tree_evaluator::visit_simple_assignment(octave::tree_simple_assignment&) (pt-eval.cc:2681)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B8DCC: octave::tree_evaluator::visit_statement(octave::tree_statement&) (pt-eval.cc:2776)
==192290==    by 0x52B2903: octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) (pt-stmt.h:119)
==192290==    by 0x52C06CC: octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) (pt-stmt.h:194)
==192290==    by 0x533DF06: octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-usr-fcn.cc:455)
==192290==  Address 0x676be90 is 0 bytes inside data symbol "_ZZN5ArrayIdE7nil_repEvE2nr"
==192290==
==192290== Invalid free() / delete / delete[] / realloc()
==192290==    at 0x483B0D6: operator delete(void*, unsigned long) (vg_replace_malloc.c:595)
==192290==    by 0x2AB0C03F: Array<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~Array() (in /usr/lib64/octave/packages/io-2.4.13/x86_64-redhat-linux-gnu-api-v53/csv2cell.oct)
==192290==    by 0x2AB089AA: ??? (in /usr/lib64/octave/packages/io-2.4.13/x86_64-redhat-linux-gnu-api-v53/csv2cell.oct)
==192290==    by 0x5415AF1: octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-builtin.cc:65)
==192290==    by 0x52BCDA9: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (pt-eval.cc:2008)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B7A09: octave::tree_evaluator::visit_simple_assignment(octave::tree_simple_assignment&) (pt-eval.cc:2681)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B8DCC: octave::tree_evaluator::visit_statement(octave::tree_statement&) (pt-eval.cc:2776)
==192290==    by 0x52B2903: octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) (pt-stmt.h:119)
==192290==    by 0x52C06CC: octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) (pt-stmt.h:194)
==192290==    by 0x533DF06: octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-usr-fcn.cc:455)
==192290==  Address 0x676bb80 is 0 bytes inside data symbol "_ZZN5ArrayINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE7nil_repEvE2nr"
==192290==
==192290== Invalid free() / delete / delete[] / realloc()
==192290==    at 0x483B0D6: operator delete(void*, unsigned long) (vg_replace_malloc.c:595)
==192290==    by 0x2AB0C866: Array<octave_value>::~Array() (in /usr/lib64/octave/packages/io-2.4.13/x86_64-redhat-linux-gnu-api-v53/csv2cell.oct)
==192290==    by 0x2AB089B2: ??? (in /usr/lib64/octave/packages/io-2.4.13/x86_64-redhat-linux-gnu-api-v53/csv2cell.oct)
==192290==    by 0x5415AF1: octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-builtin.cc:65)
==192290==    by 0x52BCDA9: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (pt-eval.cc:2008)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B7A09: octave::tree_evaluator::visit_simple_assignment(octave::tree_simple_assignment&) (pt-eval.cc:2681)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B8DCC: octave::tree_evaluator::visit_statement(octave::tree_statement&) (pt-eval.cc:2776)
==192290==    by 0x52B2903: octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) (pt-stmt.h:119)
==192290==    by 0x52C06CC: octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) (pt-stmt.h:194)
==192290==    by 0x533DF06: octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-usr-fcn.cc:455)
==192290==  Address 0x5b57fb0 is 0 bytes inside data symbol "_ZZN5ArrayI12octave_valueE7nil_repEvE2nr"
==192290==
==192290== Invalid read of size 4
==192290==    at 0x2AB0C86B: Array<octave_value>::~Array() (in /usr/lib64/octave/packages/io-2.4.13/x86_64-redhat-linux-gnu-api-v53/csv2cell.oct)
==192290==    by 0x2AB089B2: ??? (in /usr/lib64/octave/packages/io-2.4.13/x86_64-redhat-linux-gnu-api-v53/csv2cell.oct)
==192290==    by 0x5415AF1: octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-builtin.cc:65)
==192290==    by 0x52BCDA9: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (pt-eval.cc:2008)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B7A09: octave::tree_evaluator::visit_simple_assignment(octave::tree_simple_assignment&) (pt-eval.cc:2681)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B8DCC: octave::tree_evaluator::visit_statement(octave::tree_statement&) (pt-eval.cc:2776)
==192290==    by 0x52B2903: octave::tree_evaluator::visit_statement_list(octave::tree_statement_list&) (pt-stmt.h:119)
==192290==    by 0x52C06CC: octave::tree_evaluator::execute_user_function(octave_user_function&, int, octave_value_list const&) (pt-stmt.h:194)
==192290==    by 0x533DF06: octave_user_function::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-usr-fcn.cc:455)
==192290==    by 0x52BCDA9: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (pt-eval.cc:2008)
==192290==  Address 0xfffffffffffffff8 is not stack'd, malloc'd or (recently) free'd
==192290==
fatal: caught signal Segmentation fault -- stopping myself...
==192290==
==192290== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==192290==    at 0x48AC5D3: raise (in /usr/lib64/libc-2.30.9000.so)
==192290==    by 0x146D7E6D: os::Linux::chained_handler(int, siginfo_t*, void*) (in /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.fc32.x86_64/jre/lib/amd64/server/libjvm.so)
==192290==    by 0x146DDA17: JVM_handle_linux_signal (in /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.fc32.x86_64/jre/lib/amd64/server/libjvm.so)
==192290==    by 0x146D0D5B: signalHandler(int, siginfo_t*, void*) (in /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.fc32.x86_64/jre/lib/amd64/server/libjvm.so)
==192290==    by 0x48AC67F: ??? (in /usr/lib64/libc-2.30.9000.so)
==192290==    by 0x2AB0C86A: Array<octave_value>::~Array() (in /usr/lib64/octave/packages/io-2.4.13/x86_64-redhat-linux-gnu-api-v53/csv2cell.oct)
==192290==    by 0x2AB089B2: ??? (in /usr/lib64/octave/packages/io-2.4.13/x86_64-redhat-linux-gnu-api-v53/csv2cell.oct)
==192290==    by 0x5415AF1: octave_builtin::call(octave::tree_evaluator&, int, octave_value_list const&) (ov-builtin.cc:65)
==192290==    by 0x52BCDA9: octave::tree_evaluator::visit_index_expression(octave::tree_index_expression&) (pt-eval.cc:2008)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)
==192290==    by 0x52B7A09: octave::tree_evaluator::visit_simple_assignment(octave::tree_simple_assignment&) (pt-eval.cc:2681)
==192290==    by 0x53E771F: octave::tree_evaluator::evaluate(octave::tree_expression*, int) (pt-eval.h:312)

Orion Poplawski <opoplawski>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by opoplawski (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-11-07 mtmiller StatusNone => Invalid
        Open/ClosedOpen => Closed
    2019-11-06 mtmiller Summarystatics package test segfaults with 64bit indexes => [octave forge] (io) csv2cell segfaults with 64bit indexes (called from tblread function test)

    Back to the top


    Powered by Savane 3.5