Project

General

Profile

Actions

Bug #22191

closed

`Signal.trap(:EXIT)` exception only shown if `at_exit` also raises

Bug #22191: `Signal.trap(:EXIT)` exception only shown if `at_exit` also raises

Added by Earlopain (Earlopain _) 5 days ago. Updated 3 days ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 4.1.0dev (2026-05-29T14:34:40Z master 7a07a54298) +PRISM [x86_64-linux]
[ruby-core:126049]

Description

Signal.trap(:EXIT, proc { raise "foo" })
# No output
Signal.trap(:EXIT, proc { raise "foo" })
at_exit { raise "bar" }
# test.rb:2:in 'block in <main>': bar (RuntimeError)
# test.rb:1:in 'block in <main>': foo (RuntimeError)

A bit weird

Actions

Also available in: PDF Atom