Project

General

Profile

Actions

Bug #7084

closed

RubyVM::InstructionSequence.compile("1+"*10000 + "1") causes SystemStackError or Segmentation Fault

Added by mrkn (Kenta Murata) almost 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 2.0.0dev (2012-09-29 trunk 37053) [x86_64-darwin12.1.0]
Backport:
[ruby-dev:46174]

Description

以下のように ulimit -s の値に応じて stack level too deep と Segmentation Fault のどちらかが発生するようです。

$ .prefix/bin/ruby -v
ruby 2.0.0dev (2012-09-29 trunk 37053) [x86_64-darwin12.1.0]
$ ulimit -s
8192
$ .prefix/bin/ruby -e 'p RubyVM::InstructionSequence.compile("1+"*10000+"1")'
-e:1: stack level too deep (SystemStackError)
$ ulimit -s 32768
$ .prefix/bin/ruby -e 'p RubyVM::InstructionSequence.compile("1+"*10000+"1")'
-e:1: [BUG] Segmentation fault
ruby 2.0.0dev (2012-09-29 trunk 37053) [x86_64-darwin12.1.0]

-- Control frame information -----------------------------------------------
c:0003 p:---- s:0009 e:000008 CFUNC :compile
c:0002 p:0028 s:0005 e:000bc8 EVAL -e:1 [FINISH]
c:0001 p:0000 s:0002 e:0020e8 TOP [FINISH]

-e:1:in <main>' -e:1:in compile'

-- C level backtrace information -------------------------------------------

See Crash Report log file under ~/Library/Logs/CrashReporter or
/Library/Logs/CrashReporter, for the more detail of.

-- Other runtime information -----------------------------------------------

  • Loaded script: -e

  • Loaded features:

Actions

Also available in: Atom PDF