Hello!
I have a segfault when I use rb_eval_string() through a shared
library.
elathan@velka:~/TRuby/tmp> ruby -v
ruby 1.9.0 (2004-05-25) [i686-linux]
elathan@velka:~/TRuby/tmp> cat bug.c
#include “ruby.h”
int doit(void)
{
rb_eval_string(“puts”);
}
elathan@velka:~/TRuby/tmp> gcc bug.c -shared -o libbug.so
-I/usr/local/lib/ruby/1.9/i686-linux/ -L/usr/local/include
-lruby-static -ldl -lcrypt -lm
elathan@velka:~/TRuby/tmp> cat runit.c
int main(void)
{
doit();
}
elathan@velka:~/TRuby/tmp> gcc runit.c -lbug -L. -o runit
elathan@velka:~/TRuby/tmp> ./runit
Segmentation fault
elathan@velka:~/TRuby/tmp> gdb runit
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “i586-suse-linux”…
(gdb) run
Starting program: /home/elathan/TRuby/tmp/runit
Error while mapping shared library sections:
libbug.so: Success.
Program received signal SIGSEGV, Segmentation fault.
0x400a75ff in ?? ()
(gdb) where
#0 0x400a75ff in ?? ()
#1 0x40068f9c in ?? ()
#2 0x40050531 in ?? ()
#3 0x4004e52b in ?? ()
#4 0x08048469 in main ()
#5 0x4011e8ae in __libc_start_main () from /lib/libc.so.6
(gdb)
Regards,
···
–
University of Athens I bet the human brain
Physics Department is a kludge --Marvin Minsky