Project

General

Profile

Actions

Bug #7951

closed

Cannot rescue SignalException in 1.9.3 or 2.0.0

Added by jamesotron (James Harton) about 11 years ago. Updated over 6 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.1]
Backport:
[ruby-core:52864]

Description

When running the example provided on http://www.ruby-doc.org/core-1.9.3/SignalException.html we find that neither Ruby 1.9.3p392 nor Ruby 2.0.0p0 are able to rescue SignalException:

$ cat <<EOF >signal_exception_test.rb
puts "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}"
begin
  Process.kill('HUP',Process.pid)
rescue SignalException => e
  puts "received Exception #{e}"
end
EOF

$ rvm 1.8.7,1.9.3,2.0.0 do ruby signal_exception_test.rb
1.8.7p371
received Exception SIGHUP
1.9.3p392
/Users/jnh/.rvm/scripts/set: line 20: 99759 Hangup: 1               "${args[@]}"
2.0.0p0
/Users/jnh/.rvm/scripts/set: line 20: 99816 Hangup: 1               "${args[@]}"
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0