https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112018-04-10T12:55:45ZRuby Issue Tracking SystemRuby master - Bug #14566: `raise` in `Exception#message` causes infinite loophttps://bugs.ruby-lang.org/issues/14566?journal_id=714372018-04-10T12:55:45Zujihisa (Tatsuhiro Ujihisa)
<ul><li><strong>File</strong> <a href="/attachments/7112">fix-bug-14566.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/7112/fix-bug-14566.patch">fix-bug-14566.patch</a> added</li></ul><p>I tried making a patch fixing this issue. See attached.<br>
This patch makes the behaviour similar to the old Ruby, rescuing any exceptions in the "message" method, but also warns that an exception was automatically caught.</p>
<p>I'm not 100% sure if this is the solution that everyone wants. Also the test in the patch needs an update; I wasn't sure how to make sure if it's not causing infinite loop. I just left a draft as a comment there.</p> Ruby master - Bug #14566: `raise` in `Exception#message` causes infinite loophttps://bugs.ruby-lang.org/issues/14566?journal_id=714442018-04-11T07:08:42Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Thank you, I've missed the report mail.<br>
I think it fatal.</p> Ruby master - Bug #14566: `raise` in `Exception#message` causes infinite loophttps://bugs.ruby-lang.org/issues/14566?journal_id=714462018-04-11T08:00:05Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Backport</strong> changed from <i>2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN</i> to <i>2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED</i></li></ul><p>It should work as well as 2.4, not <code>fatal</code>.</p> Ruby master - Bug #14566: `raise` in `Exception#message` causes infinite loophttps://bugs.ruby-lang.org/issues/14566?journal_id=714472018-04-11T08:03:52Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul><p>Applied in changeset trunk|r63133.</p>
<hr>
<p>eval_error.c: fix loop on exception in message</p>
<ul>
<li>
<p>error.c (rb_get_message): accessor to the message.</p>
</li>
<li>
<p>eval_error.c (rb_ec_error_print): handle exceptions on fetching<br>
the message. [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: `raise` in `Exception#message` causes infinite loop (Closed)" href="https://bugs.ruby-lang.org/issues/14566">#14566</a>]</p>
</li>
</ul> Ruby master - Bug #14566: `raise` in `Exception#message` causes infinite loophttps://bugs.ruby-lang.org/issues/14566?journal_id=714482018-04-11T08:08:44Zujihisa (Tatsuhiro Ujihisa)
<ul></ul><p>Thx!</p> Ruby master - Bug #14566: `raise` in `Exception#message` causes infinite loophttps://bugs.ruby-lang.org/issues/14566?journal_id=735212018-08-12T10:37:09Znagachika (Tomoyuki Chikanaga)nagachika00@gmail.com
<ul><li><strong>Backport</strong> changed from <i>2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED</i> to <i>2.3: DONTNEED, 2.4: DONTNEED, 2.5: DONE</i></li></ul><p>ruby_2_5 r64319 merged revision(s) 63133.</p>