-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Milestone
Description
It looks like the performance improvements mentioned on the JRuby blog probably broke exception backtrace generation in some cases. This affected RSpec, causing the following bug: rspec/rspec-core#2299. I can reproduce the problem by running this very simple script in JRuby:
begin
raise
rescue ArgumentError
rescue StandardError => e
if e.backtrace.nil?
puts "Rescued an exception with no backtrace!"
else
puts "Looks good"
end
endHere is a shell session showing my environment and the output of that script:
$ jruby -v
jruby 9.1.7.0 (2.3.1) 2017-01-11 68056ae Java HotSpot(TM) 64-Bit Server VM 25.121-b13 on 1.8.0_121-b13 +jit [mswin32-x86_64]
$ uname -a
MINGW64_NT-10.0 URANIUM 2.6.0(0.304/5/3) 2016-09-07 20:45 x86_64 Msys
$ jruby simple.rb
Rescued an exception with no backtrace!
MRI behaves as expected and prints "Looks good" when it runs that same script.
For anyone affected by this, a workaround is to add => _ to the first rescue statement.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels