segfault on inclusion of std_vector.i
Alex <x37v.alex <at> gmail.com>
2008-07-02 08:08:09 GMT
I am using swig to generate a ruby interface for some c++ code I've
written. I want to include std_vector so that (hopefully) I input
ruby arrays into this method I have that accepts std::vector<int>.
anyways, if I build without..
%include std_vector.i
..my application builds fine, I can run my it but I cannot use this
method in ruby.
If I do include that I get this output:
$ swig -Wall -c++ -ruby datajockey.i
/usr/share/swig1.3/ruby/rubycontainer_extended.swg:136: Warning(322):
Redundant redeclaration of 'map_bang',
/usr/share/swig1.3/ruby/rubycontainer_extended.swg:136: Warning(322):
previous declaration of 'map_bang'.
/usr/share/swig1.3/ruby/rubycontainer_extended.swg:136: Warning(322):
Redundant redeclaration of '__delete__',
/usr/share/swig1.3/ruby/rubycontainer_extended.swg:136: Warning(322):
previous declaration of '__delete__'.
/usr/share/swig1.3/ruby/rubycontainer_extended.swg:137: Warning(322):
Redundant redeclaration of 'map_bang',
/usr/share/swig1.3/ruby/rubycontainer_extended.swg:137: Warning(322):
previous declaration of 'map_bang'.
/usr/share/swig1.3/ruby/rubycontainer_extended.swg:137: Warning(322):
Redundant redeclaration of '__delete__',
/usr/share/swig1.3/ruby/rubycontainer_extended.swg:137: Warning(322):
previous declaration of '__delete__'.
/usr/share/swig1.3/ruby/rubycontainer_extended.swg:138: Warning(322):
Redundant redeclaration of 'map_bang',
/usr/share/swig1.3/ruby/rubycontainer_extended.swg:138: Warning(322):
previous declaration of 'map_bang'.
/usr/share/swig1.3/ruby/rubycontainer_extended.swg:138: Warning(322):
Redundant redeclaration of '__delete__',
/usr/share/swig1.3/ruby/rubycontainer_extended.swg:138: Warning(322):
previous declaration of '__delete__'.
then, after building and running my app I get a segfault right away.
below is the gdb backtrace.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb60f0ac0 (LWP 21283)]
0xb7e1324e in st_lookup () from /usr/lib/libruby1.8.so.1.8
(gdb) bt
#0 0xb7e1324e in st_lookup () from /usr/lib/libruby1.8.so.1.8
#1 0xb7de74e2 in rb_intern () from /usr/lib/libruby1.8.so.1.8
#2 0x080863dc in __static_initialization_and_destruction_0 ()
#3 0x0809e2b5 in __do_global_ctors_aux ()
#4 0x08054820 in _init ()
#5 0x0809e259 in __libc_csu_init ()
#6 0xb6f853f1 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#7 0x08057091 in _start ()
Any ideas what's up? Am I doing something wrong or, is there a bug in
the swig-ruby library?
btw, while building [with and without that include statement], i get a
bunch of these:
swig/datajockey_wrap.cxx:5463: warning: unused parameter 'self'
swig/datajockey_wrap.cxx:5479: warning: unused parameter 'argv'
....
and a couple of these:
swig/datajockey_wrap.cxx: In function 'VALUE
_wrap_new_MixerPanelModel(int, VALUE*, VALUE)':
swig/datajockey_wrap.cxx:5193: warning: 'argv[0]' may be used
uninitialized in this function
Thanks,
Alex
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08