seg-fault of octave on MacOSX

Jean-François Mertens Jean-Francois.Mertens at uclouvain.be
Thu Dec 6 14:48:26 CST 2007


On 06 Dec 2007, at 19:17, John W. Eaton wrote:

> Since the crash is happening inside of Fsave, I think it must be one
> of the lines
>
>     save ("-binary", nm, "f2", "g2", "h2");
>
> What happens if you just execute
>
>   a = 2;
>   f = @(x) a + x;
>   g = @(x) 2 * x;
>   h = @log2;
>   f2 = f;
>   g2 = g;
>   h2 = h;
>   nm = tmpnam();
>   save ("-binary", nm, "f2", "g2", "h2");

Right _ fails too _ and already much smaller !
output:
....
octave:8> nm = tmpnam();
octave:9> save ("-binary", nm, "f2", "g2", "h2");

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x756f6d79
0x756f6d79 in ?? ()
(gdb) bt
#0  0x756f6d79 in ?? ()
#1  0x1176fd10 in std::basic_filebuf<char, std::char_traits<char>  
 >::_M_terminate_output (this=0x12e0a650) at /sw/.bld/ 
gcc42-4.2.2-1000/darwin_objdir/i686-apple-darwin8/libstdc++-v3/ 
include/bits/fstream.tcc:765
#2  0x010e1f59 in save_vars (os=@0xbfff81a8, pattern=@0x12ec18a8,  
fmt=LS_BINARY, save_as_floats=-1073774668) at load-save.cc:1122
#3  0x010e7e96 in save_vars (argv=@0xbfff81b0, argv_idx=-1073774464,  
argc=6, os=@0xbfff81b0, fmt=LS_BINARY, save_as_floats=0,  
write_header_info=1) at load-save.cc:1321
#4  0x010e8f68 in Fsave (args=@0x12e23868) at /usr/include/c++/4.0.0/ 
fstream:647
#5  0x012a919d in octave_builtin::do_multi_index_op (this=0x1345eec0,  
nargout=0, args=@0x12e23868) at ov-builtin.cc:104
#6  0x012a8b29 in octave_builtin::subsref (this=0x1345eec0,  
type=@0x12b74984, idx=@0xbfff8878, nargout=0) at ov-builtin.cc:54
#7  0x01297ae5 in octave_value::subsref (this=0xbfff8888,  
type=@0x12b74984, idx=@0xbfff8878, nargout=0) at ov.cc:783
#8  0x013c1681 in tree_index_expression::rvalue (this=0x12b74960,  
nargout=0) at pt-idx.cc:352
#9  0x013dd2ba in tree_statement::eval (this=0x12b997b0, silent=0,  
nargout=0, in_function_body=false) at pt-stmt.cc:133
#10 0x013dd6e6 in tree_statement_list::eval (this=0x12e1e7d0,  
silent=false, nargout=0) at pt-stmt.cc:190
#11 0x012056b9 in main_loop () at toplev.cc:225
#12 0x01193631 in octave_main (argc=5, argv=0xbfff8c24, embedded=0)  
at octave.cc:801
#13 0x00001fd0 in main (argc=5, argv=0xbfff8c24) at main.c:35
#14 0x0000193e in _start ()
#15 0x00001865 in start ()
(gdb)

Jean-Francois


More information about the Bug-octave mailing list