rescue doesn't work with SystemExit exceptions (Regression)
-----------------------------------------------------------

                 Key: JRUBY-1618
                 URL: http://jira.codehaus.org/browse/JRUBY-1618
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.x
         Environment: Ubuntu Linux,
ruby 1.8.5 (2007-11-25 rev 4842) [i386-jruby1.1b1]

            Reporter: Vladimir Sizikov
            Priority: Critical
         Attachments: thread_exit.diff

Rescue doesn't work with SystemExit. So, the following example (from Pickaxe 
book, no less), doesn't work as expected:

begin
  exit(99)
rescue SystemExit => e
  puts "Rescued SystemExit"
end

puts "Finished Normally"

So, under MRI:
Rescued SystemExit
Finished Normally
(and the exit status is 0, as expected)

Under JRuby: (no output!, as if JRuby exited right away, before the rescue is 
executed),
and the exit status is 99.

I've tracked down the origin of the problem to bugfix for JRUBY-1286. So, this 
is a regression.

Also, this problem manifests itself when running Rubinius spec tests for 
Thread, since SystemExit is being thrown there for testing purposes, but JRuby 
exits right away, not finishing the test run!

The provided patch fixes this problem (but I'm not sure about the problem 
described in  JRUBY-1286, will it reappear or not).




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to