From: usa@... Date: 2018-03-18T14:56:12+00:00 Subject: [ruby-core:86180] [Ruby trunk Bug#13916] Race condition when sending a signal to a new fork Issue #13916 has been updated by usa (Usaku NAKAMURA). Backport changed from 2.2: REQUIRED, 2.3: REQUIRED, 2.4: DONE to 2.2: REQUIRED, 2.3: DONE, 2.4: DONE ruby_2_3 r62816 merged revision(s) 59975. ---------------------------------------- Bug #13916: Race condition when sending a signal to a new fork https://bugs.ruby-lang.org/issues/13916#change-71067 * Author: russelldavis (Russell Davis) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16] * Backport: 2.2: REQUIRED, 2.3: DONE, 2.4: DONE ---------------------------------------- To reproduce, run this script: ~~~ ruby 1_000_000.times do |i| pid = fork {sleep} puts pid Process.kill(:TERM, pid) Process.wait(pid) end ~~~ Expected behavior: it should print a million pids and then exit. Actual behavior: after some number of iterations, it freezes on the call to `Process.wait`, because the fork never got killed by the TERM signal. (I verified with `ps` that the pid it froze on is still running.) -- https://bugs.ruby-lang.org/ Unsubscribe: