Project

General

Profile

Actions

Bug #1813

closed

Threading seg fault (1.9.1-p129 Linux/Mac)

Added by charlton (Charlton Wang) over 15 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.1p129 (2009-05-12 revision 23412) [i686-linux]
Backport:
[ruby-core:24540]

Description

=begin
I'm not sure if there is a thread stack limitation change that is new to 1.9.1 but the following code now causes a segfault on Linux and Illegal Instruction on the Mac. I know this code is somewhat ridiculous (call stack is attempting to go 1001 levels deep) but this seems to work fine in 1.8.6. If the code is executed outside of a thread, everything works fine as well.

t = Thread.new do
n = 1000
n.times do |i|
Object.class_eval <<EOF
define_method "foo#{i}" do
if i < n-1
puts i
self.send("foo#{i+1}")
else
puts "done"
end
end
EOF
end
foo0
end
t.join

Thanks,
Charlton
=end


Related issues 4 (0 open4 closed)

Related to Ruby master - Bug #2558: r24591 causes SegfaultClosed01/05/2010Actions
Related to Ruby master - Bug #4983: Fiberのガードページの設定が間違ってるClosedkosaki (Motohiro KOSAKI)07/06/2011Actions
Related to Ruby master - Bug #3781: FIBER_USE_NATIVE が有効だと落ちるスクリプトがあるClosedauthorNari (Narihiro Nakamura)09/02/2010Actions
Has duplicate Ruby master - Bug #3286: segfault in method_missing -> method -> method_missing recursive loopClosed05/13/2010Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0