qemu-ppc segfaults(SIGSEGV) on pthread_create
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
qemu-ppc running on x86-64 hardware leads to a segfault when running the
attached program (test.c). It simply creates a pthread, joins it and exits.
It was compiled as follows on a Debian testing system:
> powerpc-
Sample execution (expected output is "Hello - World!"):
> qemu-ppc -cpu e500 ./test
[...output...]
Hello - qemu-ppc: /build/
qemu-ppc: /build/
[1] 25747 segmentation fault qemu-ppc -cpu e500 test
[...end output...]
The same behavior is observed when running on a PPC 604:
> powerpc-
> qemu-ppc ./test
[... as above ...]
Version information:
powerpc-
qemu-ppc -version => qemu-ppc version 2.8.0(Debian 1:2.8+dfsg-2)
The same experiment was conducted again using qemu from the git repository (commit: 796b288f7be8750
~/tools/
[...output...]
Hello - qemu-ppc: [...redacted.
qemu-ppc: [...redacted.
[1] 25996 segmentation fault ~/tools/
[...end output...]
Executing with -strace option yields a surprising entry (see second clone() syscall below):
[...]
26007 clone(CLONE_
26007 clone(0,
test.c works just fine if the pthread_create & pthread_join calls are removed
(i.e. when compiled with -DNO_PTHREAD_
At first glance, the issue seems specific to PPC because compiling and running
for x86_64 using qemu-x86_64 works fine.
Additional info:
> lddtree =qemu-ppc
qemu-ppc => /usr/bin/qemu-ppc (interpreter => /lib64/
libgmodule-
libdl.so.2 => /lib/x86_
libglib-
librt.so.1 => /lib/x86_
libm.so.6 => /lib/x86_
libgcc_s.so.1 => /lib/x86_
libpthread.so.0 => /lib/x86_
libc.so.6 => /lib/x86_
> /lib/x86_
GNU C Library (Debian GLIBC 2.24-9) stable release version 2.24, by Roland McGrath et al.
> uname -a
Linux [...redacted...] 4.9.0-1-amd64 #1 SMP Debian 4.9.6-3 (2017-01-28) x86_64 GNU/Linux
Changed in qemu: | |
status: | Fix Committed → Fix Released |
Fixed by commit 2635531f2006bfb 0f943ad25b41e17 6709b79b37 (available in 2.9.0rc0)