[MacRuby] #1353: Segfault occurs when invoked the Module#{const_set, const_get} within some threads.
#1353: Segfault occurs when invoked the Module#{const_set, const_get} within some threads. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Maybe, I guess that this problem is similar with #1352. Test Script: {{{ #!ruby m = Module.new th = Thread.new { 1000.times do |i| m.const_set("M1#{i}", i) end } 1000.times do |i| begin m.const_get("M1#{i}") rescue end end th.join }}} BackTrace: {{{ Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000 0x00007fff83cc3c00 in strlen () (gdb) t a a bt Thread 3 (process 25779): #0 0x00000001000beccb in generic_ivar_dict (obj=8590087968, create=false) at variable.c:824 #1 0x00000001000bf0c2 in rb_class_ivar_dict (mod=8590088032) at variable.c:940 #2 0x00000001000bf0f8 in rb_class_ivar_dict_or_create (mod=8590088032) at variable.c:954 #3 0x00000001000c0e01 in mod_av_set (klass=8590088032, id=13485, val=509, isconst=2) at variable.c:1735 #4 0x00000001000c0ed6 in rb_const_set (klass=8590088032, id=13485, val=509) at variable.c:1760 #5 0x0000000100052e86 in rb_mod_const_set (mod=8590088032, sel=0x100fc1150, name=8590703360, value=509) at object.c:2153 #6 0x000000010012e927 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:163 #7 0x000000010012e927 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:466 #8 0x000000010012e927 in rb_vm_dispatch () at dispatcher.cpp:872 #9 0x0000000101500744 in ?? () #10 0x0000000101500f55 in ?? () #11 0x0000000100134ccb in __rb_vm_bcall [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:100 #12 0x0000000100134ccb in vm_block_eval [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:1221 #13 0x0000000100134ccb in rb_vm_yield_args () at dispatcher.cpp:1278 #14 0x00000001000db2fd in rb_vm_yield (argc=1, argv=0x10177f928) at vm.h:697 #15 0x00000001000db2d0 in rb_yield (val=509) at vm_eval.c:183 #16 0x000000010004d1da in int_dotimes (num=4001, sel=0x100fe7360) at numeric.c:3241 #17 0x000000010012e8b4 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:159 #18 0x000000010012e8b4 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:466 #19 0x000000010012e8b4 in rb_vm_dispatch () at dispatcher.cpp:872 #20 0x0000000101500744 in ?? () #21 0x0000000101500c81 in ?? () #22 0x0000000100132c67 in __rb_vm_bcall [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:98 #23 0x0000000100132c67 in vm_block_eval [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:1221 #24 0x0000000100132c67 in rb_vm_block_eval (b=0x200020960, argc=0, argv=0x0) at dispatcher.cpp:1228 #25 0x000000010014d093 in rb_vm_thread_run (thread=8590067808) at vm.cpp:4856 #26 0x00007fff83cf9fd6 in _pthread_start () #27 0x00007fff83cf9e89 in thread_start () Current language: auto; currently c Thread 2 (process 25779): #0 0x00007fff833da477 in Auto::WriteBarrier::range_has_marked_cards () #1 0x00007fff833ee9b4 in Auto::visitAllocatedBlocks<Auto::scan_retained_and_old_blocks_visitor> () #2 0x00007fff833ed944 in Auto::MemoryScanner::scan_retained_and_old_blocks () #3 0x00007fff833e8a47 in Auto::Collector::check_roots () #4 0x00007fff833ed8b1 in Auto::MemoryScanner::scan () #5 0x00007fff833e277d in Auto::Zone::collect () #6 0x00007fff833cba7e in auto_collect_internal () #7 0x00007fff833cc0bd in auto_collection_work () #8 0x00007fff83cfcd64 in _dispatch_call_block_and_release () #9 0x00007fff83cdb8d2 in _dispatch_queue_drain () #10 0x00007fff83cdb734 in _dispatch_queue_invoke () #11 0x00007fff83cdb2de in _dispatch_worker_thread2 () #12 0x00007fff83cdac08 in _pthread_wqthread () #13 0x00007fff83cdaaa5 in start_wqthread () Thread 1 (process 25779): #0 0x00007fff83cc3c00 in strlen () #1 0x000000010012d622 in rb_vm_dispatch () at dispatcher.cpp:698 #2 0x00000001000d9dc9 in rb_vm_call0 (vm=0x100f231d0, top=0, self=8590687424, klass=0x200037b60, sel=0x0, block=0x0, opt=2 '\002', argc=0, argv=0x0) at vm.h:654 #3 0x00000001000daeee in rb_vm_call2 (block=0x0, self=8590687424, klass=8590162784, sel=0x0, argc=0, argv=0x0) at vm.h:679 #4 0x00000001000dad8e in rb_call (recv=8590687424, mid=11488, argc=0, argv=0x0, scope=1, pass_current_block=false) at vm_eval.c:32 #5 0x00000001000db111 in rb_funcall (recv=8590687424, mid=11488, n=0) at vm_eval.c:106 #6 0x0000000100025490 in exc_message (exc=8590687424, sel=0x7fff880df27c) at error.c:455 #7 0x000000010012e8b4 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:159 #8 0x000000010012e8b4 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:466 #9 0x000000010012e8b4 in rb_vm_dispatch () at dispatcher.cpp:872 #10 0x0000000100025926 in rb_vm_call0 (vm=0x100f231d0, top=0, self=8590687424, klass=0x200037b60, sel=0x7fff880df27c, block=0x0, opt=2 '\002', argc=0, argv=0x0) at vm.h:654 #11 0x000000010002585f in rb_vm_call (self=8590687424, sel=0x7fff880df27c, argc=0, argv=0x0) at vm.h:661 #12 0x00000001000277ed in format_message (exc=8590687424) at error.c:1274 #13 0x0000000100139e2a in rb_ensure () at vm.cpp:3695 #14 0x00000001000279a8 in rb_format_exception_message (exc=8590687424) at error.c:1314 #15 0x00000001000c6925 in rb_rb2oc_exception (exc=8590687424) at objc.m:504 #16 0x0000000100148868 in __vm_raise () at vm.cpp:3561 #17 0x00000001001489fa in rb_vm_raise (exception=8590687424) at vm.cpp:3639 #18 0x0000000100028bc3 in rb_exc_raise (mesg=8590687424) at eval.c:290 #19 0x0000000100025c39 in rb_name_error (id=Could not find the frame base for "rb_name_error". ) at error.c:670 #20 0x00000001000bfb1a in uninitialized_constant (klass=8590088032, id=13109) at variable.c:1234 #21 0x00000001000bfcf4 in rb_mod_const_missing (klass=Could not find the frame base for "rb_mod_const_missing". ) at variable.c:1281 #22 0x000000010012e8e6 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:161 #23 0x000000010012e8e6 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:466 #24 0x000000010012e8e6 in rb_vm_dispatch () at dispatcher.cpp:872 #25 0x00000001000bfca1 in rb_vm_call0 (vm=0x100f231d0, top=0, self=8590088032, klass=0x200025720, sel=0x100f200c0, block=0x0, opt=2 '\002', argc=1, argv=0x7fff5fbfbfc8) at vm.h:654 #26 0x00000001000bfbda in rb_vm_call (self=8590088032, sel=0x100f200c0, argc=1, argv=0x7fff5fbfbfc8) at vm.h:661 #27 0x00000001000bfb74 in call_const_missing (klass=8590088032, id=13109) at variable.c:1246 #28 0x00000001000c04d6 in rb_const_get_0 (klass=8590088032, id=13109, exclude=0, recurse=2) at variable.c:1493 #29 0x00000001000c0537 in rb_const_get (klass=8590088032, id=13109) at variable.c:1505 #30 0x0000000100052e05 in rb_mod_const_get (mod=8590088032, sel=0x100fc1020, argc=1, argv=0x7fff5fbfd050) at object.c:2130 #31 0x000000010012e2b3 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:448 #32 0x000000010012e2b3 in rb_vm_dispatch () at dispatcher.cpp:872 #33 0x0000000101500744 in ?? () #34 0x0000000101500da1 in ?? () #35 0x0000000100134ccb in __rb_vm_bcall [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:100 #36 0x0000000100134ccb in vm_block_eval [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:1221 #37 0x0000000100134ccb in rb_vm_yield_args () at dispatcher.cpp:1278 #38 0x00000001000db2fd in rb_vm_yield (argc=1, argv=0x7fff5fbfd5f8) at vm.h:697 #39 0x00000001000db2d0 in rb_yield (val=213) at vm_eval.c:183 #40 0x000000010004d1da in int_dotimes (num=4001, sel=0x100fe7360) at numeric.c:3241 #41 0x000000010012e8b4 in __rb_vm_rcall [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:159 #42 0x000000010012e8b4 in ruby_dispatch [inlined] () at /Users/watson/src /macruby-master/dispatcher.cpp:466 #43 0x000000010012e8b4 in rb_vm_dispatch () at dispatcher.cpp:872 #44 0x0000000101500744 in ?? () #45 0x0000000101500224 in ?? () #46 0x000000010014a072 in rb_vm_run (fname=0x2000a8da0 "/Users/watson/tmp/test_const_set_get.rb", node=0x2000251e0, binding=0x0, inside_eval=false) at vm.cpp:4115 #47 0x000000010002898b in ruby_run_node (n=0x2000251e0) at eval.c:211 #48 0x0000000100000be3 in main (argc=2, argv=0x100f1c040, envp=0x7fff5fbfe7d8) at main.cpp:40 (gdb) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1353> MacRuby <http://macruby.org/>
#1353: Segfault occurs when invoked the Module#{const_set, const_get} within some threads. ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.11 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------+----------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.11 Comment: It doesn't crash anymore with https://github.com/MacRuby/MacRuby/commit/d08f39ddfa8b1816e92712334abf544af9... -- Ticket URL: <http://www.macruby.org/trac/ticket/1353#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby