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:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error
Status:  Fixed Assigned to:  None
Originator Name:  Christopher Friedt Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  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.


Fri 21 Dec 2018 08:28:14 PM UTC, comment #1:

Thank you for your bug report, and I'm sorry that no one has responded to it since it was reported over a year ago. I can confirm that there was a segmentation fault with this example using Octave 4.2, but not with the current stable release of Octave 4.4. I can't point to something specific that was fixed, but it does seem to be resolved now. If you have further Octave bugs, we hope that you do report them.

Mike Miller <mtmiller>
Project Administrator
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 Files:

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
  • -email is unavailable- added by None (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-12-21 mtmiller StatusNone => Fixed
        Open/ClosedOpen => Closed
    2017-12-12 None Attached File- => Added crash-liboctave.txt, #42621
        Attached File- => Added crash-liboctave.cpp, #42622

    Back to the top

    Powered by Savane 3.4