From: "Iñaki Baz Castillo" Date: 2012-06-13T05:03:06+09:00 Subject: Re: Thread#kill is not rescued by "rescue Exception" Hi, could somebody please comment on my question? Summarizing: int error_tag; ret = rb_protect(function, data, &error_tag); // While function() is being executed in Ruby land, // its thread is killed by other thread via Thread.kill. // If now I inspect rb_errinfo() it returns Fixnum 8, and // error_tag it's set to integer 8. I'm coding my application assuming that, in case rb_errinfo() returns a Fixnum (instead of a Exception object) then I must assume that its thread has been killed via Thread#kill. Could somebody confirm whether this assumption is correct or not? NOTE: Ruby 1.9.3-p0 MRI. Thanks a lot. 2012/6/11 Iñaki Baz Castillo : >> ret = rb_protect(function, Qnil, &error_tag); >> >>  /* >>   * If an exception occurs while in function() it can be due: >>   * >>   * - An Exception (including SystemExit), this is "rescue-able" via >> "rescue Exception" >>   *   and will run the "ensure" code if present. In this case >> rb_errinfo() gets the >>   *   exact Exception object. >>   * >>   * - A Thread#kill. This is NOT "rescue-able" via "rescue Exception" >> but it WILL run >>   *   the "ensure" code if present. In this case rb_errinfo() returns >> FIXNUM 8 (it maybe >>   *   different, no idea). > > > In order to re-check this possible "issue", I've reported it in Ruby tracker: > > http://bugs.ruby-lang.org/issues/6575 -- Iñaki Baz Castillo