From: carlosayam@... Date: 2014-03-05T07:01:40+00:00 Subject: [ruby-core:61304] [ruby-trunk - Bug #9589] Stack level too deep during eval causes segmentation fault Issue #9589 has been updated by carlos aya. Interesting, I searched the rspec-core code and it uses instance_eval/class_eval. That prompted me to try these faulty snippets... `b = Proc.new do b.instance_eval(&b) end b.instance_eval(&b) ` and this one too... `b = Proc.new do Proc.class_eval(&b) end Proc.class_eval(&b) ` Both segfault. I suspect eval, instance_eval and class_eval are not guarded against stack errors. ---------------------------------------- Bug #9589: Stack level too deep during eval causes segmentation fault https://bugs.ruby-lang.org/issues/9589#change-45635 * Author: carlos aya * Status: Open * Priority: Normal * Assignee: * Category: * Target version: * ruby -v: 1.9.3 * Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- The following silly code, which imho should generate a " stack level too deep (SystemStackError)", segfaults $ echo 'eval($_)' | ruby -n -e 'eval($_)' I thought it may be a bug, not sure. My version: carlos-mac$ ruby -v ruby 1.9.3p327 (2012-11-10) [x86_64-darwin12.2.0] -- http://bugs.ruby-lang.org/