From: "kosaki (Motohiro KOSAKI)" Date: 2012-11-28T14:10:11+09:00 Subject: [ruby-core:50249] [ruby-trunk - Bug #7450][Assigned] Thread#raise may override Thread#status unexpectedly Issue #7450 has been reported by kosaki (Motohiro KOSAKI). ---------------------------------------- Bug #7450: Thread#raise may override Thread#status unexpectedly https://bugs.ruby-lang.org/issues/7450 Author: kosaki (Motohiro KOSAKI) Status: Assigned Priority: Normal Assignee: kosaki (Motohiro KOSAKI) Category: core Target version: 2.0.0 ruby -v: ruby 2.0.0dev (2012-11-28 trunk 37921) [x86_64-linux] 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. -- http://bugs.ruby-lang.org/