From: O01eg Oleg on
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.
--
Posted via http://www.ruby-forum.com/.

From: O01eg Oleg on
It's a initialization code:

int ruby_argc = 1;
char* ruby_argv[ruby_argc];
ruby_argv[0] = "";
char** r_argv = ruby_argv;
Logger::Instance().Log(L"Ruby starting");
ruby_sysinit(&ruby_argc, &r_argv);
Logger::Instance().Log(L"Ruby: Call RUBY_INIT_STACK");
RUBY_INIT_STACK;
Logger::Instance().Log(L"Ruby: Call ruby_init");
ruby_init();
Logger::Instance().Log(L"Ruby: Call ruby_init_loadpath");
ruby_init_loadpath();
Logger::Instance().Log(L"Ruby started");


--
Posted via http://www.ruby-forum.com/.

From: O01eg Oleg on
Here ALL my code: http://bin.mypage.sk/FILES/mud.tar.bz2
--
Posted via http://www.ruby-forum.com/.

From: O01eg Oleg on
I use `autoreconf -fi`
AM_CHECK_RUBY places in m4/ruby.m4
--
Posted via http://www.ruby-forum.com/.

From: O01eg Oleg on
Yukihiro Matsumoto wrote:
> You have to wrap every call for Ruby related (possibly exception
> raising) functions, e.g. rb_require, rb_eval_string, etc.

Can I use

PUSH_TAG;
rb_requir(...)
rb_eval_string(...)
POP_TAG;

instead

PUSH_TAG;
rb_require(...)
POP_TAG;
PUSH_TAG;
rb_eval_string(...)
POP_TAG;
--
Posted via http://www.ruby-forum.com/.