[#86755] [Ruby trunk Feature#14723] [WIP] sleepy GC — normalperson@...
Issue #14723 has been reported by normalperson (Eric Wong).
6 messages
2018/04/29
[ruby-core:86504] [Ruby trunk Bug#14566] `raise` in `Exception#message` causes infinite loop
From:
ujihisa@...
Date:
2018-04-11 08:08:46 UTC
List:
ruby-core #86504
Issue #14566 has been updated by ujihisa (Tatsuhiro Ujihisa).
Thx!
----------------------------------------
Bug #14566: `raise` in `Exception#message` causes infinite loop
https://bugs.ruby-lang.org/issues/14566#change-71448
* Author: pocke (Masataka Kuwabara)
* Status: Closed
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.6.0dev (2018-03-01 trunk 62592) [x86_64-linux]
* Backport: 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED
----------------------------------------
This code does not stop.
```ruby
class A < StandardError
def message
raise
end
end
raise A
```
The following code also does not stop.
```ruby
class A < StandardError
def message
1/0
end
end
raise A
```
And they ignore CTRL-C, so I should do CTRL-Z (suspend) and `kill -9` to stop them.
I confirmed the problem in Ruby 2.5 and trunk.
```
$ ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]
$ ruby -v
ruby 2.6.0dev (2018-03-01 trunk 62592) [x86_64-linux]
```
But Ruby 2.4 and 2.3 do not stop (I does not have Ruby 2.2 because I cannot build it in my environment.).
I can get same outputs between `raise` and `1/0` in the `message` method body.
```
$ ruby -v test.rb
ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
test.rb:7:in `<main>': A
$ ruby -v test.rb
ruby 2.3.6p384 (2017-12-14 revision 61254) [x86_64-linux]
test.rb:7:in `<main>': A
```
---Files--------------------------------
fix-bug-14566.patch (1.75 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>