Project

General

Profile

Actions

Bug #13596

closed

Segfault when catching SystemStackError in eval

Added by mjones (Morgan Jones) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
[ruby-core:81366]

Description

This minimal testcase will crash most ruby versions with a SIGSEGV (though it's likely that other constructions could trigger the same behavior). Effectively, after the first SystemStackError that is caught from eval, a subsequent stack overflow will crash ruby rather than triggering another SystemStackError.

Failing testcase:

ruby -e "code = '+1' * 100000; 2.times {begin; eval code; rescue SystemStackError => e; p e; end}"
#<SystemStackError: stack level too deep>
[1]    23587 segmentation fault (core dumped)  ruby -e

Succeeding testcase:

ruby -e "def x; x; end; 2.times {begin; x; rescue SystemStackError => e; p e; end}"
#<SystemStackError: stack level too deep>
#<SystemStackError: stack level too deep>

Related issues 1 (1 open0 closed)

Is duplicate of Ruby master - Bug #13164: A second `SystemStackError` exception results in `Segmentation fault (core dumped)`OpenActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0