Am 25.06.2011 um 16:11 schrieb Andreas Färber:
Am 12.06.2011 um 22:46 schrieb Stefan Hajnoczi:
To run automated tests for coroutines:
make check-coroutine
./check-coroutine
The commit message doesn't correspond to the changes, it's test-
coroutine below.
$ ./test-coroutine
/basic/lifecycle: Segmentation fault
Compiles without warnings but crashes at runtime on Darwin/ppc64.
It's using coroutine-ucontext.o implementation.
(gdb) run
Starting program: /Users/andreas/QEMU/qemu64/test-coroutine
warning: posix_spawn failed, trying execvp, error: 86
Reading symbols for shared libraries +++++++++++++
+
....................................................................... done
/basic/lifecycle:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
qemu_coroutine_create (entry=0x2b10 <set_and_exit>) at /Users/
andreas/QEMU/qemu/qemu-coroutine.c:23
23 co->entry = entry;
(gdb)
(gdb) i r
r0 0x3690 13968
r1 0x7fff5fbff1e0 140734799802848
r2 0x7fff70231870 140735074736240
r3 0x0 0
r4 0x10080be00 4303404544
r5 0x0 0
r6 0x2 2
r7 0x0 0
r8 0x8 8
r9 0x0 0
r10 0x7fff80f14fac 140735356686252
r11 0x7fff70237940 140735074761024
r12 0x7fff80f14fa0 140735356686240
r13 0x7fff7028fde8 140735075122664
r14 0x0 0
r15 0x0 0
r16 0x0 0
r17 0x100240e94 4297330324
r18 0x100539040 4300443712
r19 0x100609400 4301296640
r20 0x0 0
r21 0x0 0
r22 0x100609b60 4301298528
r23 0x100240e94 4297330324
r24 0x100240e94 4297330324
r25 0x0 0
r26 0x0 0
r27 0x100205d78 4297088376
r28 0x7fff70231870 140735074736240
r29 0x2b10 11024
r30 0x2b10 11024
r31 0x0 0
pc 0x3690 13968
ps 0x900000000200f030 10376293541495238704
cr 0x24022222 604119586
lr 0x3690 13968
ctr 0x7fff80f14fa0 140735356686240
xer 0x20000000 536870912
mq 0x0 0
fpscr 0x82000000 2181038080
vscr 0x10000 65536
vrsave 0x0 0
(gdb) x/10i ($pc-8)
0x3688 <qemu_coroutine_create+40>: li r0,0
0x368c <qemu_coroutine_create+44>: bl 0x3ca0 <qemu_coroutine_new>
0x3690 <qemu_coroutine_create+48>: std r29,0(r3)
0x3694 <qemu_coroutine_create+52>: nop
0x3698 <qemu_coroutine_create+56>: nop
0x369c <qemu_coroutine_create+60>: nop
0x36a0 <qemu_coroutine_create+64>: ld r0,120(r1)
0x36a4 <qemu_coroutine_create+68>: ld r2,0(r28)
0x36a8 <qemu_coroutine_create+72>: xor. r0,r0,r2
0x36ac <qemu_coroutine_create+76>: li r2,0
(gdb)