bugGNU Octave - Bugs: bug #52650, Segfault when loading package via...


bug #52650: Segfault when loading package via C++ API

Submitted by:  None
Submitted on:  Tue 12 Dec 2017 08:23:57 PM UTC  
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Unexpected Error
Status: NoneAssigned to: None
Originator Name: Christopher FriedtOriginator Email: -unavailable-
Open/Closed: OpenRelease: 4.2.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.


Tue 12 Dec 2017 08:23:57 PM UTC, original submission:


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.


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 ()



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

Attach File(s):

Attached Files
file #42621:  crash-liboctave.txt added by None (11KiB - text/plain)
file #42622:  crash-liboctave.cpp added by None (386B - text/x-c++src)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by None (Submitted the item)

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

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 12 Dec 2017 08:23:57 PM UTCNoneAttached File-=>Added crash-liboctave.txt, #42621
      Attached File-=>Added crash-liboctave.cpp, #42622

    Back to the top

    Powered by Savane 3.1-cleanup1