Hi,
I've got a nice gdb stack trace:
(gdb) run
Starting program: /home/jurij/tmp/ruby1.9.1-1.9.2~svn28788/miniruby -I./lib
-I.ext/common -I./- -r./ext/purelib.rb ./tool/runruby.rb --extout=.ext --
./test/ruby/test_fiber.rb
[Thread debugging using libthread_db enabled]
[New Thread 0xf7ac5b70 (LWP 967)]
[Thread 0xf7ac5b70 (LWP 967) exited]
process 964 is executing new program:
/home/jurij/tmp/ruby1.9.1-1.9.2~svn28788/ruby1.9.1
[Thread debugging using libthread_db enabled]
[New Thread 0xf78d9b70 (LWP 968)]
Loaded suite ./test/ruby/test_fiber
Started
created fiber
Program received signal SIGSEGV, Segmentation fault.
rb_threadptr_execute_interrupts_rec (th=0x0, sched_depth=0) at thread.c:1261
1261 if (th->raised_flag) return;
(gdb) bt
#0 rb_threadptr_execute_interrupts_rec (th=0x0, sched_depth=0) at thread.c:1261
#1 0xf7f55944 in fiber_switch (fibval=2131728, argc=0, argv=0x210f70) at
cont.c:977
#2 rb_fiber_resume (fibval=2131728, argc=0, argv=0x210f70) at cont.c:998
#3 0xf7f381d0 in call_cfunc (func=0xf7f55960 <rb_fiber_m_resume>,
recv=2131728, len=-1, argc=0, argv=0x210f70) at vm_insnhelper.c:314
#4 0xf7f4618c in vm_call_cfunc (th=0x232f0, cfp=0x214ed4, num=0,
blockptr=<value optimized out>, flag=0, id=9896, me=0xbafa0, recv=2131728)
at vm_insnhelper.c:401
#5 vm_call_method (th=0x232f0, cfp=0x214ed4, num=0, blockptr=<value optimized
out>, flag=0, id=9896, me=0xbafa0, recv=2131728) at vm_insnhelper.c:523
#6 0xf7f3def8 in vm_exec_core (th=0x232f0, initial=<value optimized out>) at
insns.def:1006
#7 0xf7f43be0 in vm_exec (th=0x232f0) at vm.c:1145
#8 0xf7f45c94 in invoke_block_from_c (th=0x232f0, proc=0x210c58, self=2131800,
argc=0, argv=0xffffd39c, blockptr=0x0) at vm.c:557
#9 rb_vm_invoke_proc (th=0x232f0, proc=0x210c58, self=2131800, argc=0,
argv=0xffffd39c, blockptr=0x0) at vm.c:603
#10 0xf7f55dec in rb_fiber_start () at cont.c:857
#11 0xf7e4599c in ruby_cleanup (ex=0) at eval.c:154
#12 0xf7e45a4c in ruby_run_node (n=0x3ecb8) at eval.c:254
#13 0x0001083c in main (argc=3, argv=0xffffd664) at main.c:35
(gdb) info thread
3 Thread 0xf78d9b70 (LWP 968) 0xf7dbc1e4 in
pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/ultra3/libpthread.so.0
* 1 Thread 0xf7fee6d0 (LWP 964) rb_threadptr_execute_interrupts_rec (th=0x0,
sched_depth=0) at thread.c:1261
(gdb) thread 3
[Switching to thread 3 (Thread 0xf78d9b70 (LWP 968))]#0 0xf7dbc1e4 in
pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/ultra3/libpthread.so.0
(gdb) bt
#0 0xf7dbc1e4 in pthread_cond_timedwait@@GLIBC_2.3.2 () from
/lib/ultra3/libpthread.so.0
#1 0xf7f51318 in native_cond_timedwait (dummy=0x0) at thread_pthread.c:127
#2 thread_timer (dummy=0x0) at thread_pthread.c:777
#3 0xf7db6458 in start_thread () from /lib/ultra3/libpthread.so.0
#4 0xf7bc135c in ?? () from /lib/ultra3/libc.so.6
#5 0xf7bc135c in ?? () from /lib/ultra3/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) quit
In this example the test_fiber.rb script has been reduced to:
----8<-----
require 'test/unit'
require 'fiber'
require 'continuation'
class TestFiber < Test::Unit::TestCase
def test_resume_self
f = Fiber.new {f.resume}
print "created fiber"
assert_raise(FiberError, '[ruby-core:23651]') {f.transfer}
end
end
----8<-----
Thread 3 is ruby timer thread started during initialization of the
interpreter, while the other thread is executing the test.
Best regards,
--
Jurij Smakov [email protected]
Key: http://www.wooyd.org/pgpkey/ KeyID: C99E03CC
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]