From: nobu.nokada@... Date: 2005-09-07T08:15:22+09:00 Subject: Re: [BUG?] SystemExit & abort_on_exception in latest "ruby_1_8" Hi, At Wed, 7 Sep 2005 00:41:57 +0900, Johan Holmberg wrote in [ruby-core:05724]: > I have noticed a change in the effect of Thread.abort_on_exception in > the latest "ruby_1_8" version in CVS, compared to 1.8.2. The following > script works differently: (snip) > Is this change intentional, or a bug? Sorry, a bug. * eval.c (rb_thread_switch): convert all exceptions to SystemExit. fixed: [ruby-core:05724] * eval.c (rb_thread_terminated): show backtrace before propagate exceptions to main thread. Index: eval.c =================================================================== RCS file: /cvs/ruby/src/ruby/eval.c,v retrieving revision 1.823 diff -U2 -p -r1.823 eval.c --- eval.c 5 Sep 2005 08:36:39 -0000 1.823 +++ eval.c 6 Sep 2005 23:12:07 -0000 @@ -10531,4 +10531,7 @@ rb_thread_switch(n) ruby_errinfo = th_raise_exception; ruby_current_node = th_raise_node; + if (!rb_obj_is_kind_of(ruby_errinfo, rb_eSystemExit)) { + terminate_process(EXIT_FAILURE, ruby_errinfo); + } rb_exc_raise(th_raise_exception); break; @@ -12171,4 +12174,5 @@ rb_thread_terminated(th, state, status) else if (th->safe < 4 && (ruby_thread_abort || th->abort || RTEST(ruby_debug))) { /* exit on main_thread */ + error_print(); rb_thread_main_jump(ruby_errinfo, RESTORE_EXIT); } -- Nobu Nakada