From: BG - Ben Armstrong Date: 2005-05-12T03:00:00+09:00 Subject: Lost in the bowels of eval.c: fflush in Thread deadlocks in VMS Ruby port Help. I'm lost in the bowels of eval.c! Somehow doing fflush() in a Thread breaks in our OpenVMS port of Ruby: Here is a minimal failing test case: $ ruby -v -e"Thread.new{STDOUT.flush}.join" ruby 1.8.2 (2004-12-16) [alpha-vms] deadlock 0x1bdf20: sleep:S - thread.rb:1 deadlock 0x1cc1e8: sleep:J(0x1bdf20) (main) - thread.rb:1 thread.rb:1:in `join': Thread(0x1cc1e8): deadlock (fatal) from thread.rb:1 So it appears that one thread (the flush thread) is sleeping, and one thread is waiting to join (the main thread) and now rb_schedule_thread() has nothing to do, so it throws the fatal deadlock error. How did we end up in this state? What should I be looking for now? Thanks, Ben