From: Bill Kelly Date: 2004-08-26T13:31:36+09:00 Subject: [BUG?] apparent hang (win32 and Linux), have stack trace ------=_NextPart_000_0393_01C48AEB.490BE340 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi Ruby interals gurus ! I'm hoping anyone can tell me, based on the attached stack trace (from CVS 1.8.2preview2, [i386-mswin32]), whether this is indicitave of a bug in Ruby. I have a fairly small script now, which hangs on both win32 (1.8.2preview2) and linux (1.8.0). It takes anywhere from a few minutes to a few hours to lock up. (You can just start it at let it run, no interaction required.) On Linux, I am able to ^C the process and get a ruby stack trace. On Windows ^C doesn't abort (common enough when stuck in Windows IO routines), but I was able to attach the debugger to the process and get a stack trace. The script is at: http://bwk.homeip.net/ftp/buffered-io-test4a.rb The ruby stack trace I get when interrupting the hung process on Linux, is always at or immediately following the Thread.stop in ConditionVariable#wait: /usr/local/lib/ruby/1.8/thread.rb:192:in `stop': Interrupt from /usr/local/lib/ruby/1.8/thread.rb:192:in `wait' from /usr/local/lib/ruby/1.8/thread.rb:190:in `exclusive_unlock' from /usr/local/lib/ruby/1.8/thread.rb:140:in `exclusive' from /usr/local/lib/ruby/1.8/thread.rb:140:in `exclusive_unlock' from /usr/local/lib/ruby/1.8/thread.rb:190:in `wait' from buffered-io-test4a.rb:59:in `global_wait' from buffered-io-test4a.rb:58:in `synchronize' from buffered-io-test4a.rb:58:in `global_wait' from buffered-io-test4a.rb:87 from buffered-io-test4a.rb:72:in `loop' from buffered-io-test4a.rb:88 The windows stack trace (attached) always looks about the same each time, too. (rb_thread_stop -> rb_thread_schedule -> rb_w32_select). Thanks for your help !! Regards, Bill ------=_NextPart_000_0393_01C48AEB.490BE340 Content-Type: text/plain; name="hang-1.8.2preview2-stacktrace.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="hang-1.8.2preview2-stacktrace.txt" "The process appears to be deadlocked (or is not running any user-mode = code)." [[note: I believe gc_mark_children() to be showing up erroneously in = the trace.]] NTDLL.DLL!77f82ca0() =20 msafd.dll!74fd3bac() =20 msvcrt-ruby18.dll!gc_mark_children(unsigned long ptr=3D1, int = lev=3D37778976) Line 753 + 0xc C ws2_32.dll!750312f5() =20 msvcrt-ruby18.dll!rb_w32_select(int nfds=3D1, fd_set * rd=3D0x02407620, = fd_set * wr=3D0x02407750, fd_set * ex=3D0x02407870, timeval * = timeout=3D0x00000000) Line 1870 + 0x1e C 1865: RUBY_CRITICAL({ 1866: r =3D select(nfds, rd, wr, ex, timeout); 1867: if (r =3D=3D SOCKET_ERROR) { 1868: errno =3D map_errno(WSAGetLastError()); 1869: } > 1870: }); msvcrt-ruby18.dll!rb_thread_schedule() Line 10190 + 0x2b C 10189: >10190: n =3D select(max+1, &readfds, &writefds, &exceptfds, = delay_ptr); 10191: if (n < 0) { msvcrt-ruby18.dll!rb_thread_stop() Line 10882 C 10880: curr_thread->status =3D THREAD_STOPPED; >10881: rb_thread_schedule(); 10882: curr_thread->status =3D last_status; msvcrt-ruby18.dll!call_cfunc() Line 5405 + 0x7 C msvcrt-ruby18.dll!rb_call0() Line 5536 + 0x1c C msvcrt-ruby18.dll!rb_call(unsigned long klass=3D44588960, unsigned long = recv=3D44588984, unsigned long mid=3D5041, int argc=3D0, const unsigned = long * argv=3D0x00000000, int scope=3D0) Line 5757 + 0x28 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44517416, RNode * = n=3D0x02a717c8) Line 3257 + 0xb4 C msvcrt-ruby18.dll!rb_yield_0(unsigned long val=3D6, unsigned long = self=3D44517416, unsigned long klass=3D0, int flags=3D0, int avalue=3D0) = Line 4745 + 0xd C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44514224, RNode * = n=3D0x02a71ff0) Line 3053 + 0x16 C msvcrt-ruby18.dll!rb_yield_0(unsigned long val=3D6, unsigned long = self=3D44514224, unsigned long klass=3D0, int flags=3D0, int avalue=3D0) = Line 4745 + 0xd C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44588984, RNode * = n=3D0x02a74360) Line 3053 + 0x16 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44588984, RNode * = n=3D0x02a74300) Line 3201 + 0x10 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44588984, RNode * = n=3D0x02a741c8) Line 3113 + 0x10 C msvcrt-ruby18.dll!rb_call0() Line 5664 + 0xd C msvcrt-ruby18.dll!rb_call(unsigned long klass=3D44588960, unsigned long = recv=3D44588984, unsigned long mid=3D11041, int argc=3D0, const unsigned = long * argv=3D0x00000000, int scope=3D0) Line 5757 + 0x28 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44514224, RNode * = n=3D0x02a723b0) Line 3257 + 0xb4 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44514224, RNode * = n=3D0x02a71fa8) Line 2977 + 0x10 C msvcrt-ruby18.dll!rb_call0() Line 5664 + 0xd C msvcrt-ruby18.dll!rb_call(unsigned long klass=3D44529080, unsigned long = recv=3D44514224, unsigned long mid=3D11121, int argc=3D0, const unsigned = long * argv=3D0x00000000, int scope=3D0) Line 5757 + 0x28 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44517416, RNode * = n=3D0x02a71900) Line 3257 + 0xb4 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44517416, RNode * = n=3D0x02a71768) Line 2977 + 0x10 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44517416, RNode * = n=3D0x02a71648) Line 3113 + 0x10 C msvcrt-ruby18.dll!rb_call0() Line 5664 + 0xd C msvcrt-ruby18.dll!rb_call(unsigned long klass=3D44528408, unsigned long = recv=3D44517416, unsigned long mid=3D8545, int argc=3D1, const unsigned = long * argv=3D0x0240c008, int scope=3D0) Line 5757 + 0x28 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44601944, RNode * = n=3D0x02a75ec0) Line 3257 + 0xb4 C msvcrt-ruby18.dll!rb_yield_0(unsigned long val=3D6, unsigned long = self=3D44601944, unsigned long klass=3D0, int flags=3D0, int avalue=3D0) = Line 4745 + 0xd C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44514224, RNode * = n=3D0x02a72698) Line 3053 + 0x16 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44514224, RNode * = n=3D0x02a725c0) Line 3113 + 0x10 C msvcrt-ruby18.dll!rb_call0() Line 5664 + 0xd C msvcrt-ruby18.dll!rb_call(unsigned long klass=3D44529080, unsigned long = recv=3D44514224, unsigned long mid=3D9929, int argc=3D0, const unsigned = long * argv=3D0x00000000, int scope=3D0) Line 5757 + 0x28 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44601944, RNode * = n=3D0x02a75f68) Line 3257 + 0xb4 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44601944, RNode * = n=3D0x02a75e60) Line 2977 + 0x10 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44601944, RNode * = n=3D0x02a75cb0) Line 3113 + 0x10 C msvcrt-ruby18.dll!rb_call0() Line 5664 + 0xd C msvcrt-ruby18.dll!rb_call(unsigned long klass=3D44607896, unsigned long = recv=3D44601944, unsigned long mid=3D9945, int argc=3D1, const unsigned = long * argv=3D0x0240e93c, int scope=3D1) Line 5757 + 0x28 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44601944, RNode * = n=3D0x02a74e88) Line 3272 + 0x9f C msvcrt-ruby18.dll!rb_yield_0(unsigned long val=3D6, unsigned long = self=3D44601944, unsigned long klass=3D0, int flags=3D0, int avalue=3D0) = Line 4745 + 0xd C msvcrt-ruby18.dll!rb_f_loop() Line 4889 + 0xf C msvcrt-ruby18.dll!call_cfunc() Line 5405 + 0x7 C msvcrt-ruby18.dll!rb_call0() Line 5536 + 0x1c C msvcrt-ruby18.dll!rb_call(unsigned long klass=3D44607752, unsigned long = recv=3D44601944, unsigned long mid=3D3929, int argc=3D0, const unsigned = long * argv=3D0x00000000, int scope=3D1) Line 5757 + 0x28 C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44601944, RNode * = n=3D0x02a74e58) Line 3272 + 0x9f C msvcrt-ruby18.dll!rb_eval(unsigned long self=3D44601944, RNode * = n=3D0x02a77528) Line 2977 + 0x10 C msvcrt-ruby18.dll!eval_node() Line 1287 + 0xd C msvcrt-ruby18.dll!ruby_exec() Line 1456 + 0x12 C msvcrt-ruby18.dll!ruby_run() Line 1477 + 0x5 C ruby.exe!main() Line 52 C ruby.exe!mainCRTStartup() Line 398 + 0xe C KERNEL32.DLL!7c581af6() =20 ------=_NextPart_000_0393_01C48AEB.490BE340--