From: Yukihiro Matsumoto Date: 2010-04-25T02:29:30+09:00 Subject: Re: Segmentation fault at raise exception. Hi, In message "Re: Segmentation fault at raise exception." on Sun, 25 Apr 2010 02:23:22 +0900, O01eg Oleg writes: |Can I use | | PUSH_TAG; | rb_requir(...) | rb_eval_string(...) | POP_TAG; Yes, but you have to do PUSH_TAG(); if ((state = EXEC_TAG()) == 0) { rb_requir(...) rb_eval_string(...) } POP_TAG(); or use rb_protect utility function. My modified code was static VALUE LoadFile0(VALUE filename) { return rb_require((const char *)filename); } void Ruby::RubyImpl::LoadFile(const char *filename) { int state; rb_protect(LoadFile0, (VALUE)filename, &state); // you can check state==0 for success. } matz.