ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:90332] [Ruby trunk Bug#15385] Ruby process hang in ensure
       [not found] <redmine.issue-15385.20181206014021@ruby-lang.org>
@ 2018-12-06  1:40 ` pawel.pacana
  2018-12-06  5:25 ` [ruby-core:90333] " ujihisa
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: pawel.pacana @ 2018-12-06  1:40 UTC (permalink / raw)
  To: ruby-core

Issue #15385 has been reported by pawelpacana (Paweł Pacana).

----------------------------------------
Bug #15385: Ruby process hang in ensure
https://bugs.ruby-lang.org/issues/15385

* Author: pawelpacana (Paweł Pacana)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
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.
 



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:90333] [Ruby trunk Bug#15385] Ruby process hang in ensure
       [not found] <redmine.issue-15385.20181206014021@ruby-lang.org>
  2018-12-06  1:40 ` [ruby-core:90332] [Ruby trunk Bug#15385] Ruby process hang in ensure pawel.pacana
@ 2018-12-06  5:25 ` ujihisa
  2018-12-07 19:33 ` [ruby-core:90373] " pawel.pacana
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: ujihisa @ 2018-12-06  5:25 UTC (permalink / raw)
  To: ruby-core

Issue #15385 has been updated by ujihisa (Tatsuhiro Ujihisa).


This reproduces even without timeout library.

~~~ ruby
def doh
  raise
ensure
  123 if false
end

doh
~~~

looks like this is because the optimizer removed `if false` or `if nil` without adding `nop` iseq.

----------------------------------------
Bug #15385: Ruby process hang in ensure
https://bugs.ruby-lang.org/issues/15385#change-75444

* Author: pawelpacana (Paweł Pacana)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:90373] [Ruby trunk Bug#15385] Ruby process hang in ensure
       [not found] <redmine.issue-15385.20181206014021@ruby-lang.org>
  2018-12-06  1:40 ` [ruby-core:90332] [Ruby trunk Bug#15385] Ruby process hang in ensure pawel.pacana
  2018-12-06  5:25 ` [ruby-core:90333] " ujihisa
@ 2018-12-07 19:33 ` pawel.pacana
  2018-12-11 11:53 ` [ruby-core:90419] " nagachika00
  2019-01-14 11:40 ` [ruby-core:91078] " nagachika00
  4 siblings, 0 replies; 5+ messages in thread
From: pawel.pacana @ 2018-12-07 19:33 UTC (permalink / raw)
  To: ruby-core

Issue #15385 has been updated by pawelpacana (Paweł Pacana).


> ujihisa (Tatsuhiro Ujihisa) wrote:
> looks like this is because the optimizer removed `if false` or `if nil` without adding `nop` iseq.

Could it be related then to https://bugs.ruby-lang.org/issues/14959#note-7 and https://bugs.ruby-lang.org/issues/15392 then?

----------------------------------------
Bug #15385: Ruby process hang in ensure
https://bugs.ruby-lang.org/issues/15385#change-75483

* Author: pawelpacana (Paweł Pacana)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:90419] [Ruby trunk Bug#15385] Ruby process hang in ensure
       [not found] <redmine.issue-15385.20181206014021@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2018-12-07 19:33 ` [ruby-core:90373] " pawel.pacana
@ 2018-12-11 11:53 ` nagachika00
  2019-01-14 11:40 ` [ruby-core:91078] " nagachika00
  4 siblings, 0 replies; 5+ messages in thread
From: nagachika00 @ 2018-12-11 11:53 UTC (permalink / raw)
  To: ruby-core

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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:91078] [Ruby trunk Bug#15385] Ruby process hang in ensure
       [not found] <redmine.issue-15385.20181206014021@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2018-12-11 11:53 ` [ruby-core:90419] " nagachika00
@ 2019-01-14 11:40 ` nagachika00
  4 siblings, 0 replies; 5+ messages in thread
From: nagachika00 @ 2019-01-14 11:40 UTC (permalink / raw)
  To: ruby-core

Issue #15385 has been updated by nagachika (Tomoyuki Chikanaga).


Memo:  r61591, r61592, r66324 are related.

----------------------------------------
Bug #15385: Ruby process hang in ensure
https://bugs.ruby-lang.org/issues/15385#change-76307

* 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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-14 11:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-15385.20181206014021@ruby-lang.org>
2018-12-06  1:40 ` [ruby-core:90332] [Ruby trunk Bug#15385] Ruby process hang in ensure pawel.pacana
2018-12-06  5:25 ` [ruby-core:90333] " ujihisa
2018-12-07 19:33 ` [ruby-core:90373] " pawel.pacana
2018-12-11 11:53 ` [ruby-core:90419] " nagachika00
2019-01-14 11:40 ` [ruby-core:91078] " nagachika00

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).