[MacRuby] #1357: Segfault occurs when invoked a Kernel#eval within some threads.
MacRuby
ruby-noreply at macosforge.org
Sun Jul 10 10:17:47 PDT 2011
#1357: Segfault occurs when invoked a Kernel#eval within some threads.
----------------------------------+-----------------------------------------
Reporter: watson1978@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords:
----------------------------------+-----------------------------------------
Test Script:
{{{
#!ruby
th = Thread.new {
10000.times do
eval "1 + 2"
end
}
10000.times do
eval "3 + 4"
end
th.join
puts :ok
}}}
BackTrace:
{{{
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000107bc1000
0x00007fff83610380 in libunwind::LocalAddressSpace::getEncodedP ()
(gdb) t a a bt
Thread 5 (process 27911):
#0 0x00007fff834f4a2a in __workq_kernreturn ()
#1 0x00007fff834f4e3c in _pthread_wqthread ()
#2 0x00007fff834f4aa5 in start_wqthread ()
Thread 4 (process 27911):
#0 0x00007fff834f4a2a in __workq_kernreturn ()
#1 0x00007fff834f4e3c in _pthread_wqthread ()
#2 0x00007fff834f4aa5 in start_wqthread ()
Thread 3 (process 27911):
#0 0x00007fff834dadc2 in semaphore_wait_signal_trap ()
#1 0x00007fff834e040d in pthread_mutex_lock ()
#2 0x00000001000ee31d in RoxorCore::lock (this=0x102068200) at vm.h:852
#3 0x000000010015a6ce in RoxorCoreLock::RoxorCoreLock (this=0x10171e0cf)
at vm.cpp:95
#4 0x0000000100149af4 in rb_vm_run (fname=0x10099e4d4 "(eval)",
node=0x200274460, binding=0x0, inside_eval=true) at vm.cpp:4079
#5 0x000000010014a0a5 in rb_vm_run_under () at vm.cpp:4230
#6 0x000000010014a2b7 in rb_vm_eval_string (self=8590062368, klass=0,
src=8592598944, binding=0x0, file=0x10099e4d4 "(eval)", line=1,
should_push_outer=false) at vm.cpp:4274
#7 0x00000001000db411 in eval_string_with_should_push_outer
(self=8590062368, klass=0, src=8592598944, scope=4, file=0x10099e4d4
"(eval)", line=1, should_push_outer=false) at vm_eval.c:299
#8 0x00000001000db4e0 in eval_string (self=8590062368, klass=0,
src=8592598944, scope=4, file=0x10099e4d4 "(eval)", line=1) at
vm_eval.c:320
#9 0x00000001000db8aa in rb_f_eval (self=8590062368, sel=0x100f27180,
argc=1, argv=0x10171f380) at vm_eval.c:441
#10 0x000000010012deb3 in ruby_dispatch [inlined] () at /Users/watson/src
/macruby-master/dispatcher.cpp:448
#11 0x000000010012deb3 in rb_vm_dispatch () at dispatcher.cpp:872
#12 0x00000001016006d4 in ?? ()
#13 0x0000000101600e71 in ?? ()
#14 0x0000000100134887 in __rb_vm_bcall [inlined] () at /Users/watson/src
/macruby-master/dispatcher.cpp:98
#15 0x0000000100134887 in vm_block_eval [inlined] () at /Users/watson/src
/macruby-master/dispatcher.cpp:1221
#16 0x0000000100134887 in rb_vm_yield_args () at dispatcher.cpp:1278
#17 0x00000001000daefd in rb_vm_yield (argc=1, argv=0x10171f928) at
vm.h:697
#18 0x00000001000daed0 in rb_yield (val=19605) at vm_eval.c:183
#19 0x000000010004cdda in int_dotimes (num=40001, sel=0x100fe7370) at
numeric.c:3241
#20 0x000000010012e4b4 in __rb_vm_rcall [inlined] () at /Users/watson/src
/macruby-master/dispatcher.cpp:159
#21 0x000000010012e4b4 in ruby_dispatch [inlined] () at /Users/watson/src
/macruby-master/dispatcher.cpp:466
#22 0x000000010012e4b4 in rb_vm_dispatch () at dispatcher.cpp:872
#23 0x00000001016006d4 in ?? ()
#24 0x0000000101600c01 in ?? ()
#25 0x0000000100132867 in __rb_vm_bcall [inlined] () at /Users/watson/src
/macruby-master/dispatcher.cpp:98
#26 0x0000000100132867 in vm_block_eval [inlined] () at /Users/watson/src
/macruby-master/dispatcher.cpp:1221
#27 0x0000000100132867 in rb_vm_block_eval (b=0x2000a8d40, argc=0,
argv=0x0) at dispatcher.cpp:1228
#28 0x000000010014ccf7 in rb_vm_thread_run (thread=8590070112) at
vm.cpp:4864
#29 0x00007fff83513fd6 in _pthread_start ()
#30 0x00007fff83513e89 in thread_start ()
Thread 2 (process 27911):
#0 0x00007fff834f4a2a in __workq_kernreturn ()
#1 0x00007fff834f4e3c in _pthread_wqthread ()
#2 0x00007fff834f4aa5 in start_wqthread ()
Thread 1 (process 27911):
#0 0x00007fff83610380 in libunwind::LocalAddressSpace::getEncodedP ()
#1 0x00007fff8361595c in
libunwind::CFI_Parser<libunwind::LocalAddressSpace>::decodeFDE ()
#2 0x00007fff836105ff in _unw_add_dynamic_fde ()
#3 0x000000010045d009 in (anonymous
namespace)::JITEmitter::finishFunction () at Type.h:511
#4 0x00000001001e3eea in (anonymous
namespace)::Emitter<llvm::JITCodeEmitter>::runOnMachineFunction () at
vector.tcc:300
#5 0x00000001004e270d in llvm::MachineFunctionPass::runOnFunction () at
Type.h:511
#6 0x0000000100904ea0 in llvm::FPPassManager::runOnFunction () at
vector.tcc:300
#7 0x000000010090503c in llvm::FunctionPassManagerImpl::run () at
vector.tcc:300
#8 0x0000000100905329 in llvm::FunctionPassManager::run () at
vector.tcc:300
#9 0x000000010044b80a in llvm::JIT::jitTheFunction () at vector.tcc:300
#10 0x000000010044be81 in llvm::JIT::getPointerToFunction () at
vector.tcc:300
#11 0x00000001001423fa in RoxorCore::compile (this=0x102068200,
func=0x108072ab0, run_optimize=true) at vm.cpp:595
#12 0x0000000100149c07 in rb_vm_run (fname=0x10099e4d4 "(eval)",
node=0x200279480, binding=0x0, inside_eval=true) at vm.cpp:4111
#13 0x000000010014a0a5 in rb_vm_run_under () at vm.cpp:4230
#14 0x000000010014a2b7 in rb_vm_eval_string (self=8590062368, klass=0,
src=8592570400, binding=0x0, file=0x10099e4d4 "(eval)", line=1,
should_push_outer=false) at vm.cpp:4274
#15 0x00000001000db411 in eval_string_with_should_push_outer
(self=8590062368, klass=0, src=8592570400, scope=4, file=0x10099e4d4
"(eval)", line=1, should_push_outer=false) at vm_eval.c:299
#16 0x00000001000db4e0 in eval_string (self=8590062368, klass=0,
src=8592570400, scope=4, file=0x10099e4d4 "(eval)", line=1) at
vm_eval.c:320
#17 0x00000001000db8aa in rb_f_eval (self=8590062368, sel=0x100f27180,
argc=1, argv=0x7fff5fbfc6d0) at vm_eval.c:441
#18 0x000000010012deb3 in ruby_dispatch [inlined] () at /Users/watson/src
/macruby-master/dispatcher.cpp:448
#19 0x000000010012deb3 in rb_vm_dispatch () at dispatcher.cpp:872
#20 0x00000001016006d4 in ?? ()
#21 0x0000000101600d41 in ?? ()
#22 0x0000000100134887 in __rb_vm_bcall [inlined] () at /Users/watson/src
/macruby-master/dispatcher.cpp:98
#23 0x0000000100134887 in vm_block_eval [inlined] () at /Users/watson/src
/macruby-master/dispatcher.cpp:1221
#24 0x0000000100134887 in rb_vm_yield_args () at dispatcher.cpp:1278
#25 0x00000001000daefd in rb_vm_yield (argc=1, argv=0x7fff5fbfcc78) at
vm.h:697
#26 0x00000001000daed0 in rb_yield (val=19609) at vm_eval.c:183
#27 0x000000010004cdda in int_dotimes (num=40001, sel=0x100fe7370) at
numeric.c:3241
#28 0x000000010012e4b4 in __rb_vm_rcall [inlined] () at /Users/watson/src
/macruby-master/dispatcher.cpp:159
#29 0x000000010012e4b4 in ruby_dispatch [inlined] () at /Users/watson/src
/macruby-master/dispatcher.cpp:466
#30 0x000000010012e4b4 in rb_vm_dispatch () at dispatcher.cpp:872
#31 0x00000001016006d4 in ?? ()
#32 0x0000000101600188 in ?? ()
#33 0x0000000100149ca2 in rb_vm_run (fname=0x200023a80
"/Users/watson/tmp/t.rb", node=0x200020de0, binding=0x0,
inside_eval=false) at vm.cpp:4123
#34 0x000000010002858b in ruby_run_node (n=0x200020de0) at eval.c:211
#35 0x0000000100000be3 in main (argc=2, argv=0x100f1c030,
envp=0x7fff5fbfde38) at main.cpp:40
(gdb)
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/1357>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list