[MacRuby] #1283: Segfault occurs when gets the busy loop with some threads.
#1283: Segfault occurs when gets the busy loop with some threads. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Test Script: {{{ #!ruby c1 = c2 = 0 t1 = Thread.new { loop { c1 += 1 } } t2 = Thread.new { loop { c2 += 1 } }.join(1) }}} BackTrace: {{{ Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: 13 at address: 0x0000000000000000 [Switching to process 74301 thread 0x2307] 0x00000001016007b6 in ?? () (gdb) thread apply all bt Thread 4 (process 74301): #0 0x00000001016007b6 in ?? () #1 0x0000000101601324 in ?? () #2 0x00000001016013e1 in ?? () #3 0x0000000100133dff in __rb_vm_bcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:98 #4 0x0000000100133dff in vm_block_eval [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:1248 #5 0x0000000100133dff in rb_vm_yield_args () at dispatcher.cpp:1305 #6 0x00000001000daa39 in rb_vm_yield (argc=1, argv=0x1017da908) at vm.h:700 #7 0x00000001000daa0c in rb_yield (val=3053733) at vm_eval.c:183 #8 0x000000010004c9a6 in int_dotimes (num=4000000001, sel=0x100fef140) at numeric.c:3241 #9 0x000000010012d8e8 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:159 #10 0x000000010012d8e8 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:466 #11 0x000000010012d8e8 in rb_vm_dispatch () at dispatcher.cpp:886 #12 0x0000000101600834 in ?? () #13 0x0000000101600f99 in ?? () #14 0x0000000100131d43 in __rb_vm_bcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:98 #15 0x0000000100131d43 in vm_block_eval [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:1248 #16 0x0000000100131d43 in rb_vm_block_eval (b=0x2000a5d00, argc=0, argv=0x0) at dispatcher.cpp:1255 #17 0x000000010014c5af in rb_vm_thread_run (thread=8590561088) at vm.cpp:4917 #18 0x00007fff85cb24f6 in _pthread_start () #19 0x00007fff85cb23a9 in thread_start () Thread 3 (process 74301): #0 0x00007fff88329912 in _class_getMethod () #1 0x00007fff88329841 in look_up_method () #2 0x000000010012c3ea in rb_vm_dispatch () at dispatcher.cpp:635 #3 0x0000000101600834 in ?? () #4 0x0000000101601324 in ?? () #5 0x0000000101601071 in ?? () #6 0x0000000100133dff in __rb_vm_bcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:98 #7 0x0000000100133dff in vm_block_eval [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:1248 #8 0x0000000100133dff in rb_vm_yield_args () at dispatcher.cpp:1305 #9 0x00000001000daa39 in rb_vm_yield (argc=0, argv=0x0) at vm.h:700 #10 0x00000001000da9f8 in rb_yield (val=6) at vm_eval.c:181 #11 0x00000001000dad03 in loop_i () at vm_eval.c:229 #12 0x0000000100148063 in rb_rescue2 (b_proc=0x1000dacea <loop_i>, data1=0, r_proc=0, data2=0) at vm.cpp:3752 #13 0x00000001000dada3 in rb_f_loop (rcv=8590064992, sel=0x100fe3eb0) at vm_eval.c:259 #14 0x000000010012d8e8 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:159 #15 0x000000010012d8e8 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:466 #16 0x000000010012d8e8 in rb_vm_dispatch () at dispatcher.cpp:886 #17 0x0000000101600834 in ?? () #18 0x0000000101600e7a in ?? () #19 0x0000000100131d43 in __rb_vm_bcall [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:98 #20 0x0000000100131d43 in vm_block_eval [inlined] () at /Users/watson/src /macruby-trunk/dispatcher.cpp:1248 #21 0x0000000100131d43 in rb_vm_block_eval (b=0x200098ac0, argc=0, argv=0x0) at dispatcher.cpp:1255 #22 0x000000010014c5af in rb_vm_thread_run (thread=8590298752) at vm.cpp:4917 #23 0x00007fff85cb24f6 in _pthread_start () #24 0x00007fff85cb23a9 in thread_start () Thread 2 (process 74301): #0 0x00007fff85c92f4a in __workq_kernreturn () #1 0x00007fff85c9335c in _pthread_wqthread () #2 0x00007fff85c92fc5 in start_wqthread () Thread 1 (process 74301): #0 0x000000010003462b in rb_node_release (node=0x20005d800) at gc.c:335 #1 0x0000000100034836 in rb_node_release (node=0x20005d7c0) at gc.c:355 #2 0x000000010003485f in rb_node_release (node=0x20004d3c0) at gc.c:394 #3 0x000000010003488a in rb_node_release (node=0x20004c400) at gc.c:413 #4 0x0000000100034829 in rb_node_release (node=0x20005c4c0) at gc.c:345 #5 0x000000010003488a in rb_node_release (node=0x20003c4a0) at gc.c:413 #6 0x0000000100034829 in rb_node_release (node=0x20004c800) at gc.c:345 #7 0x000000010003485f in rb_node_release (node=0x20005e140) at gc.c:394 #8 0x0000000100034836 in rb_node_release (node=0x20007c800) at gc.c:355 #9 0x0000000100034843 in rb_node_release (node=0x20007c840) at gc.c:361 #10 0x000000010003488a in rb_node_release (node=0x200099a40) at gc.c:413 #11 0x000000010014967c in rb_vm_run (fname=0x200088e40 "/Users/watson/tmp/test_thread.rb", node=0x200099a40, binding=0x0, inside_eval=false) at vm.cpp:4238 #12 0x00000001000280e0 in ruby_run_node (n=0x200099a40) at eval.c:211 #13 0x0000000100000be3 in main (argc=3, argv=0x100f1c050, envp=0x7fff5fbfdeb8) at main.cpp:40 Current language: auto; currently c (gdb) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1283> MacRuby <http://macruby.org/>
#1283: Segfault occurs when gets the busy loop with some threads. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Comment(by lsansonetti@…): Looks like it's crashing when finalizing the process (during exit). {{{ c1 = c2 = 0 t1 = Thread.new { loop { c1 += 1 } } t2 = Thread.new { loop { c2 += 1 } }.join(1) p :ok sleep 2 }}} In my environment, it continues 2 more seconds. -- Ticket URL: <http://www.macruby.org/trac/ticket/1283#comment:1> MacRuby <http://macruby.org/>
#1283: Segfault occurs when gets the busy loop with some threads. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby Later Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * milestone: => MacRuby Later Comment: This should be fixed if there was a solid way of canceling all running threads during exit, but sadly there is not (because not all threads will hit a cancelation point). I think this is an edge case, so I'm scheduling the bug for Later. -- Ticket URL: <http://www.macruby.org/trac/ticket/1283#comment:2> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby