octave-maintainers
[Top][All Lists]
Advanced

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

Re: segfault when embedding the interpreter


From: John W. Eaton
Subject: Re: segfault when embedding the interpreter
Date: Sat, 12 Oct 2013 09:25:33 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

On 10/12/2013 03:47 AM, c. wrote:
Hi,

With a recent version of the development sources
whenever I try to run standalone programs embedding the interpretr, e.g. 
examples/embedded.cc, I get a segfault.

$ hg id
1e8f8900a041 tip @
$ mkoctfile -g --link-stand-alone embedded.cc -o embedded
$ ./embedded


Below is the result of running the program in the interpreter
and the backtrace of the segfault.

GCD of [10, 15] is 5

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x00000001024e4b1e in std::_Rb_tree_increment ()
(gdb) bt
#0  0x00000001024e4b1e in std::_Rb_tree_increment ()
#1  0x000000010036e7c0 in symbol_table::erase_subfunctions_in_scope ()
(gdb)


last time this was working was a couple of weeks ago.
I submitted this as a bug: https://savannah.gnu.org/bugs/index.php?40248

Can anyone confirm this behaviour?

I see a different problem:

coredump:2103> LD_LIBRARY_PATH=/usr/local/octave/dev/lib/octave/3.7.7+ ./embedded
  GCD of [10, 15] is 5
*** Error in `./embedded': corrupted double-linked list: 0x00000000017e23d0 ***

This failure doesn't happen for me if I exit the program with
"clean_up_and_exit (0)" instead of just returning.  But I don't think
that should be needed.

First, are you sure you are linking with the correct libraries?  Is it
possible that when you run the program it is being linked with some
older set of libraries?  If I do that, I get a segfault.

Either way, there does seem to be a problem because I don't think it
should be necessary to call clean_up_and_exit unless you need to
process atexit functions.  The other memory cleanup things that
clean_up_and_exit performs should be optional.

It might help if someone could bisect and find out when this problem
started happening.

jwe


reply via email to

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