Tue 12 Dec 2017 08:23:57 PM UTC, original submission:
Hi,
I've been trying to use the C++ API, and I noticed a major unexpected difference between versions 4.0.0 and 4.2.0.
Specifically, with 4.2.0, a segmentation fault occurs when I call
feval( "pkg", ovl( "load", "signal" ), 0 )
This didn't happen in Version 4.0.0, and should not happen according to the documentation for 4.2.0.
https://www.gnu.org/software/octave/doc/v4.2.0/Standalone-Programs.html#Standalone-Programs
My C++ program is quite simple:
$ cat ~/Desktop/crash-liboctave.cpp
#include <iostream>
#include <octave/oct.h>
#include <octave/octave.h>
#include <octave/parse.h>
#include <octave/toplev.h>
int main ( int argc, char *argv[] ) {
string_vector octave_argv ( 2 );
octave_argv( 0 ) = "embedded";
octave_argv( 1 ) = "-q";
octave_main( 2, octave_argv.c_str_vec(), 1 );
feval( "pkg", ovl( "load", "signal" ), 0 );
clean_up_and_exit ( 0 );
}
Backtrace is below:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff73fe2a0 in tree_statement_list::accept(tree_walker&) () from /usr/lib/octave/4.2.0/liboctinterp.so.4
(gdb) bt
#0 0x00007ffff73fe2a0 in tree_statement_list::accept(tree_walker&) () from /usr/lib/octave/4.2.0/liboctinterp.so.4
#1 0x00007ffff7313296 in octave_user_function::do_multi_index_op(int, octave_value_list const&, std::__cxx11::list<octave_lvalue, std::allocator<octave_lvalue> > const*) () from /usr/lib/octave/4.2.0/liboctinterp.so.4
#2 0x00007ffff730c704 in octave_user_function::do_multi_index_op(int, octave_value_list const&) () from /usr/lib/octave/4.2.0/liboctinterp.so.4
#3 0x00007ffff7316c05 in octave_value::do_multi_index_op(int, octave_value_list const&) () from /usr/lib/octave/4.2.0/liboctinterp.so.4
#4 0x00007ffff73a0c5b in feval(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, octave_value_list const&, int)
() from /usr/lib/octave/4.2.0/liboctinterp.so.4
#5 0x0000000000401de3 in main ()
|