octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #52650] Segfault when loading package via C++


From: anonymous
Subject: [Octave-bug-tracker] [bug #52650] Segfault when loading package via C++ API
Date: Tue, 12 Dec 2017 15:23:58 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?52650>

                 Summary: Segfault when loading package via C++ API
                 Project: GNU Octave
            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: None
             Assigned to: None
         Originator Name: Christopher Friedt
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.0
        Operating System: GNU/Linux

    _______________________________________________________

Details:

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



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 12 Dec 2017 08:23:57 PM UTC  Name: crash-liboctave.txt  Size: 11KiB 
 By: None

<http://savannah.gnu.org/bugs/download.php?file_id=42621>
-------------------------------------------------------
Date: Tue 12 Dec 2017 08:23:57 PM UTC  Name: crash-liboctave.cpp  Size: 386B  
By: None

<http://savannah.gnu.org/bugs/download.php?file_id=42622>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52650>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]