From: Brian Candler Date: 2003-07-23T23:49:04+09:00 Subject: Re: Embedding problem - SEGV On Wed, Jul 23, 2003 at 10:58:55PM +0900, Brian Candler wrote: > If I still want a regular Ruby exception report printed, after catching it, > is there a function I can call? (Partially answering own question) error_print is private, but ruby_stop() does generate the error report. I still think there must be a better solution. I am actually writing back-ruby for openldap, and it's full of functions like this: int ruby_back_db_open( BackendDB *be ) { RubyBackend *ruby_back = (RubyBackend *) be->be_private; ldap_pvt_thread_mutex_lock( &ruby_interpreter_mutex ); ruby_back->rb_obj_ref = rb_funcall(ruby_back->rb_class, rb_intern("new"), 0); ldap_pvt_thread_mutex_unlock( &ruby_interpreter_mutex ); return 0; } It looks like I'm going to have to split all these functions into two: one to do the Ruby work, and one to call it using rb_protect (and pass a struct* between the two if there's more than one argument), purely to prevent the coredumps. This is pretty nasty. Before now, it was looking that back-ruby was going to be much cleaner than back-perl :-( Cheers, Brian.