From bug-request at octave dot org Tue Jan 31 06:49:46 2006 Subject: Octave_map segfault From: Hugo MERCIER To: bug at octave dot org Date: Tue, 31 Jan 2006 13:52:03 +0100 Hi, I have a problem with the use of Octave_map With the following function, written in C++ (mtest.cc) : #include #include #include #include DEFUN_DLD(mtest, args, nargout, "") { octave_value_list retval; std::cout << args(0).is_map() << std::endl; const Octave_map& m = args(0).map_value(); std::cout << m.length() << std::endl; return retval; } Octave segfaults when attemping to call the Octave_map destructor Here is a gdb trace: octave:1> k.j="t"; octave:2> mtest(k) 1 0 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1238288704 (LWP 3654)] 0xb63b6ab9 in free () from /lib/tls/libc.so.6 (gdb) bt #0 0xb63b6ab9 in free () from /lib/tls/libc.so.6 #1 0xb6095d23 in operator delete () from /usr/lib/libstdc++.so.5 #2 0xb6095d7f in operator delete[] () from /usr/lib/libstdc++.so.5 #3 0xb71d014b in ~dim_vector_rep (this=0x8a5d2d8) at dim-vector.h:99 #4 0xb71cfc59 in ~dim_vector (this=0xbfa2c54c) at dim-vector.h:187 #5 0xb71cfbc9 in ~Octave_map (this=0xbfa2c540) at oct-map.h:76 #6 0xb71cf988 in Fmtest (args= at 0x8a98008, nargout=0) at mtest.cc:17 #7 0xb7b53451 in octave_builtin::do_multi_index_op () from /usr/lib/octave-2.1.72/liboctinterp.so Previous frame inner to this frame (corrupt stack?) (gdb) I'm using Octave 2.1.72 (on Debian testing). Any idea ? Thanks. ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------