Project

General

Profile

Actions

Bug #7450

closed

Thread#raise may override Thread#status unexpectedly

Added by kosaki (Motohiro KOSAKI) over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 2.0.0dev (2012-11-28 trunk 37921) [x86_64-linux]
Backport:
[ruby-core:50249]

Description

test.rb

ary = []

t = Thread.new {
begin
sleep
ensure
begin
ary << Thread.current.status
sleep
ensure
ary << Thread.current.status
end
end
}

sleep 0.01
t.kill
sleep 0.01
t.raise

begin
sleep
ensure
p ary
end

expected result

["aborting", "aborting"]

actual result

["aborting", "run"]

reason

rb_threadptr_execute_interrupt() overides th->status unconditionally.

Actions

Also available in: Atom PDF