From: "samphippen (Sam Phippen)" Date: 2013-06-08T09:09:54+09:00 Subject: [ruby-core:55365] [ruby-trunk - Bug #8501][Open] Reentrant exceptions in at_exit hook Issue #8501 has been reported by samphippen (Sam Phippen). ---------------------------------------- Bug #8501: Reentrant exceptions in at_exit hook https://bugs.ruby-lang.org/issues/8501 Author: samphippen (Sam Phippen) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.1.0dev (2013-06-08) [x86_64-darwin12.3.0] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN Actual Behaviour: Running this file: ``` class MyStupidClass def self.inspect raise "LOOOOOL" end end at_exit { p $! } at_exit { MyStupidClass.nope } ``` gives a 0 exit code and the following output: ``` foo.rb:8:in `block in
': undefined method `nope' for # (NoMethodError) nil ``` Expected Behaviour: A non-zero exit code, and $! populated in the at_exit hook. Notes Reproducible on ruby 2.1.0dev (2013-06-08), 2.0.0p0 and 1.9.3p392. On 1.8.7 the output is: ``` foo.rb:8: undefined method `nope' for # (NoMethodError) from foo.rb:8 # ``` And the exit code is 1. -- http://bugs.ruby-lang.org/