Bug #166

Signal handling and sleep() don't work together

Added by Dave Thomas over 6 years ago. Updated almost 4 years ago.

[ruby-core:17270]
Status:Closed
Priority:Normal
Assignee:-
ruby -v: Backport:

Description

=begin
Setting up a sleep seems to interfere with signal handlers. The following code

trap("CLD") do
pid = Process.wait
puts "Child pid #{pid}: terminated"
end

exec("/bin/sh -c 'echo hello'") if fork.nil?
puts "start"
sleep 2
puts "done"

Outputs start/hello/done with no delay, and the trap never fires. Replace the sleep with a gets, and the signal handler gets invoked—it never writes “Child xxx terminated.”
=end

Associated revisions

Revision 36964
Added by Zachary Scott over 2 years ago

  • array.c (rb_ary_select): Update documentation for Array#select
  • enum.c (enum_find_all, enum_reject): Update documentation for Enumerable#find_all and Enumerable#reject Based on a patch by Jeff Saracco [Bug #6908] [Fixes #166 on github]

Revision 36964
Added by Zachary Scott over 2 years ago

  • array.c (rb_ary_select): Update documentation for Array#select
  • enum.c (enum_find_all, enum_reject): Update documentation for Enumerable#find_all and Enumerable#reject Based on a patch by Jeff Saracco [Bug #6908] [Fixes #166 on github]

History

#1 Updated by Nobuyoshi Nakada over 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r17973.
=end

Also available in: Atom PDF