(gdb) bt #0 0x00007ffff58ebd78 in siglongjmp () from /lib/libc.so.6 #1 0x00007ffff719d3e7 in rb_longjmp (tag=6, mesg=6652280) at eval.c:442 #2 0x00007ffff719d422 in rb_exc_raise (mesg=6652280) at eval.c:453 #3 0x00007ffff719a380 in rb_raise (exc=6723760,
fmt=0x7ffff72dc28c “no such file to load – %s”) at error.c:1172
It’s caused because GET_THREAD()->tag equal to 0x0.
Could you show us the code? The interpreter may not be initialized
properly.
matz.
In message “Re: Segmentation fault at raise exception.”
on Sat, 24 Apr 2010 23:38:34 +0900, O01eg Oleg [email protected]
writes:
|I get segfault at any Ruby exception with C API:
|
|(gdb) bt
|#0 0x00007ffff58ebd78 in siglongjmp () from /lib/libc.so.6
|#1 0x00007ffff719d3e7 in rb_longjmp (tag=6, mesg=6652280) at eval.c:442
|#2 0x00007ffff719d422 in rb_exc_raise (mesg=6652280) at eval.c:453
|#3 0x00007ffff719a380 in rb_raise (exc=6723760,
| fmt=0x7ffff72dc28c “no such file to load – %s”) at error.c:1172
|
|It’s caused because GET_THREAD()->tag equal to 0x0.
I didn’t have AM_CHECK_RUBY, and configure failed to find <ruby.h>.
My version of automake was 1.11.1.
When we can compile it, then how can we run the program to reproduce
the problem?
matz.
p.s.
I skim the code, you combined the interpreter with C++ code, C++
exceptions and threads, all of which are highly difficult to run
safely with the Ruby interpreter.
In message “Re: Segmentation fault at raise exception.”
on Sun, 25 Apr 2010 00:48:06 +0900, O01eg Oleg [email protected]
writes:
In message “Re: Segmentation fault at raise exception.”
on Sun, 25 Apr 2010 02:10:04 +0900, O01eg Oleg [email protected]
writes:
|Thanks. Do I have to use this wrap for each thread which use ruby code?
You have to wrap every call for Ruby related (possibly exception
raising) functions, e.g. rb_require, rb_eval_string, etc. And bad
news is that if you call ruby functions from different threads, they
might crash, since some (or most) of them are not thread-safe.