Project

General

Profile

Actions

Bug #10218

closed

手続きを再帰するとSegmentation faultが発生する

Added by zonuexe (Kenta USAMI) over 10 years ago. Updated over 10 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
[ruby-dev:48526]

Description

stack level too deep (SystemStackError)が発生することを期待した。

% ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
% ruby -e"r = ->(n){ print %(#{n},); r.(n+1) }; r.(0)" > /tmp/foo_out 2>/tmp/foo_err
zsh: abort      ruby -e"r = ->(n){ print %(#{n},); r.(n+1) }; r.(0)" > /tmp/foo_out 2>/tmp/foo_err

(クラッシュレポートは添付)

なお、手元の環境では2.2.0devでは発生しない。

% ruby -v
ruby 2.2.0dev (2014-09-09 trunk 47479) [x86_64-darwin13]
% ruby -e"r = ->(n){ print %(#{n},); r.(n+1) }; r.(0)" > /tmp/a1
-e:1:in `block in <main>': stack level too deep (SystemStackError)
	from -e:1:in `call'
	from -e:1:in `block in <main>'
	from -e:1:in `call'
	from -e:1:in `block in <main>'
	from -e:1:in `call'
	from -e:1:in `block in <main>'
	from -e:1:in `call'
	from -e:1:in `block in <main>'
	 ... 6498 levels...
	from -e:1:in `call'
	from -e:1:in `block in <main>'
	from -e:1:in `call'
	from -e:1:in `<main>'

Files

ruby_2014-09-10-012731_tadsan-air.crash (46.9 KB) ruby_2014-09-10-012731_tadsan-air.crash zonuexe (Kenta USAMI), 09/09/2014 04:42 PM

Related issues 2 (0 open2 closed)

Related to Ruby master - Bug #9945: Segmentation fault when defining recursive methodClosed06/14/2014Actions
Is duplicate of Ruby master - Bug #9454: The define_method(:class) segfaultClosed01/26/2014Actions

Updated by zonuexe (Kenta USAMI) over 10 years ago

https://bugs.ruby-lang.org/issues/9945 と同じ原因で、既に修正済みのような気がする

Updated by nagachika (Tomoyuki Chikanaga) over 10 years ago

  • Related to Bug #9945: Segmentation fault when defining recursive method added

Updated by nagachika (Tomoyuki Chikanaga) over 10 years ago

  • Is duplicate of Bug #9454: The define_method(:class) segfault added

Updated by nagachika (Tomoyuki Chikanaga) over 10 years ago

  • Status changed from Open to Closed

おっしゃる通り #9454#9945 と同様で、 trunk では修正済み、2.1 ブランチでも(おそらく 2.0.0 でも)同様の修正が取り込まれているはずです。(RubyCI では稀にまだ失敗することがあるようですが)。

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0