From: nagachika00@... Date: 2018-12-11T11:53:07+00:00 Subject: [ruby-core:90419] [Ruby trunk Bug#15385] Ruby process hang in ensure Issue #15385 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 2.4: UNKNOWN, 2.5: UNKNOWN to 2.4: REQUIRED, 2.5: REQUIRED I didn't confirm this can be reproduced on ruby_2_4 too. After a quick code reading, I think it might be. ---------------------------------------- Bug #15385: Ruby process hang in ensure https://bugs.ruby-lang.org/issues/15385#change-75574 * Author: pawelpacana (Pawe�� Pacana) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18] * Backport: 2.4: REQUIRED, 2.5: REQUIRED ---------------------------------------- While playing with mutation testing of my code I've found a weird mutation that hangs Ruby process. The isolated code which triggers this freeze is: ~~~ ruby require 'timeout' puts Process.pid def raise_before_returning raise [] end def doh value = raise_before_returning ensure # p value # <-- that unblocks it value if nil end Timeout.timeout(3) do doh end ~~~ 1. `Timeout` is unnecessary and was added to illustrate that it has no effect to interrupt hanged process. 2. `Process.pid` is printed for convenience to kill hanged process. 3. Printing `value` in ensure changes behavior, there is no hang when encountering `value if nil` below. I've also checked `ruby 2.6.0preview3 (2018-11-06 trunk 65578) [x86_64-darwin18]` and the problem persists. ---Files-------------------------------- reproduce.rb (216 Bytes) -- https://bugs.ruby-lang.org/ Unsubscribe: