SourceForge.net | 12 Aug 16:49
Favicon
Gravatar

[ swig-Bugs-2021598 ] segfault on inclusion of std_vector.i [ruby]

Bugs item #2021598, was opened at 2008-07-18 11:23
Message generated for change (Comment added) made by neomantra
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2021598&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: ruby
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Alex Norman (alexnorman)
Assigned to: Nobody/Anonymous (nobody)
Summary: segfault on inclusion of std_vector.i [ruby]

Initial Comment:
I have tested this with the most recent version of swig (1.3.36) as well as the ubuntu package.

If I include std_vector.i in my swig wrapper and make a ruby wrapper, I get a segfault right when I start my
app.  I am not building the swig wrapper into a library, I am building it directly into my application and
calling Foo_init(); I have attached a small example which works fine with out std_vector.i but segfaults
when starting the app if I include std_vector.i.  By the way, I am building under ubuntu/linux hardy (8.04LTS).

when I include std_vector.i i also get these errors while building:

swig -Wall -c++ -ruby foo.i
/usr/local/share/swig/1.3.36/ruby/rubycontainer_extended.swg:136: Warning(322): Redundant
redeclaration of 'map_bang',
/usr/local/share/swig/1.3.36/ruby/rubycontainer_extended.swg:136: Warning(322): previous
declaration of 'map_bang'.
/usr/local/share/swig/1.3.36/ruby/rubycontainer_extended.swg:136: Warning(322): Redundant
redeclaration of '__delete__',
/usr/local/share/swig/1.3.36/ruby/rubycontainer_extended.swg:136: Warning(322): previous
declaration of '__delete__'.
/usr/local/share/swig/1.3.36/ruby/rubycontainer_extended.swg:137: Warning(322): Redundant
redeclaration of 'map_bang',
/usr/local/share/swig/1.3.36/ruby/rubycontainer_extended.swg:137: Warning(322): previous
declaration of 'map_bang'.
/usr/local/share/swig/1.3.36/ruby/rubycontainer_extended.swg:137: Warning(322): Redundant
redeclaration of '__delete__',
/usr/local/share/swig/1.3.36/ruby/rubycontainer_extended.swg:137: Warning(322): previous
declaration of '__delete__'.
/usr/local/share/swig/1.3.36/ruby/rubycontainer_extended.swg:138: Warning(322): Redundant
redeclaration of 'map_bang',
/usr/local/share/swig/1.3.36/ruby/rubycontainer_extended.swg:138: Warning(322): previous
declaration of 'map_bang'.
/usr/local/share/swig/1.3.36/ruby/rubycontainer_extended.swg:138: Warning(322): Redundant
redeclaration of '__delete__',
/usr/local/share/swig/1.3.36/ruby/rubycontainer_extended.swg:138: Warning(322): previous
declaration of '__delete__'.
g++ -g foo.cpp main.cpp foo_wrap.cxx -o foo_test -I/usr/lib/ruby/1.8/i486-linux/ -lruby1.8

here is the backtrace from gdb:

09:16:46 $ gdb ./foo_test 
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) run
Starting program: /home/alex/projects/swig_vector_segfault/foo_test 
[Thread debugging using libthread_db enabled]
[New Thread 0xb7c026c0 (LWP 30045)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7c026c0 (LWP 30045)]
0xb7f570de in st_lookup () from /usr/lib/libruby1.8.so.1.8
(gdb) bt
#0  0xb7f570de in st_lookup () from /usr/lib/libruby1.8.so.1.8
#1  0xb7f2b312 in rb_intern () from /usr/lib/libruby1.8.so.1.8
#2  0x0804a623 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535)
at foo_wrap.cxx:2067
#3  0x0804a776 in global constructors keyed to _ZN4swig8GC_VALUE7hash_idE () at foo_wrap.cxx:4163
#4  0x080504b5 in __do_global_ctors_aux ()
#5  0x08049654 in _init ()
#6  0x08050459 in __libc_csu_init ()
#7  0xb7c683f1 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#8  0x08049b51 in _start ()
(gdb)

----------------------------------------------------------------------

Comment By: Evan Wies (neomantra)
Date: 2008-08-12 09:53

Message:
Logged In: YES 
user_id=774353
Originator: NO

you might want to see my bug #2048064, which is related to stl and ruby...
i discovered it while migrating from Dapper to Hardy.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2021598&group_id=1645

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane