Project

General

Profile

Actions

Backport #1995

closed

for-in+binding+local_variables = [BUG] Segmentation fault in 1.9.1p243

Added by Mzim (Michael Zimmerman) about 15 years ago. Updated over 13 years ago.

Status:
Closed
[ruby-core:25125]

Description

=begin
While playing around with for-in I've found the following bit of code causes a segfault for me:

def kaboom!
bnd = yield
p bnd.eval("local_variables")
end

for x in enum_for(:kaboom!)
binding
end

c:/users/michael/foo2.rb:3: [BUG] Segmentation fault
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]

-- control frame ----------
c:0009 p:---- s:0024 b:0024 l:000023 d:000023 CFUNC :inspect
c:0008 p:---- s:0022 b:0022 l:000021 d:000021 CFUNC :inspect
c:0007 p:---- s:0020 b:0020 l:000019 d:000019 CFUNC :p
c:0006 p:0028 s:0016 b:0016 l:000015 d:000015 METHOD c:/users/michael/foo2.rb:3
c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :each
c:0003 p:0034 s:0007 b:0007 l:001574 d:000968 EVAL c:/users/michael/foo2.rb:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:001574 d:001574 TOP

-- Ruby level backtrace information-----------------------------------------
c:/users/michael/foo2.rb:3:in inspect' c:/users/michael/foo2.rb:3:in inspect'
c:/users/michael/foo2.rb:3:in p' c:/users/michael/foo2.rb:3:in kaboom!'
c:/users/michael/foo2.rb:6:in each' c:/users/michael/foo2.rb:6:in '

[NOTE]
You may encounter a bug of Ruby interpreter. Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
=end


Related issues 1 (0 open1 closed)

Has duplicate Backport191 - Backport #2120: Kernel.eval("local_variables", binding) in for SEGV in 1.9.1Closedyugui (Yuki Sonoda)09/19/2009Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0