From: Lucas Nussbaum Date: 2011-08-29T13:56:43+09:00 Subject: [ruby-core:39175] Re: [Ruby 1.9 - Bug #5239] bootstraptest/runner.rb: assert_normal_exit logic broken on Debian/GNU kFreeBSD On 29/08/11 at 12:43 +0900, KOSAKI Motohiro wrote: > > I've just checked, and FreeBSD 8.2 is also affected by this issue. > > Test script: > > system("false") > > sleep 0.5 > > th = Thread::new { $? } > > p th > > th.join > > p th > > p th.value > > This is buggy. $? is thread local storage variable. last exit value > was set to main thread. > because system() was called from it. Therefore it fail even if run on linux. Right, sorry. > In the other hand, on assert_normal_exit(), io.close is called from > sub thread. it's a source > of difference. Right, it changes the order of termination. > Please try following code. it work on linux. > > io = IO.popen("false") > th = Thread.new { > io.read > io.close > v = $? > p v > v > } > sleep 0.5 > > p th > th.join > p th > p th.value Indeed, that works on FreeBSD 8.2: # # # # - Lucas