Red Hat Bugzilla – Bug 601192
fork causes trouble for vcpu threads
Last modified: 2013-01-09 17:41:01 EST
Description of problem:
Guest stops running when qemu receives SIGCHILD.
Version-Release number of selected component (if applicable):
(1) boot guest
(2) make qemu fork+exec something which exits quicky.
"netdev_add tap,id=foo,script=/bin/true" will do.
Guest stops running.
Guest continues running.
Disabling the qemu SIGCHLD signal handler makes the problem disappear. Not a good idea though.
Blocking SIGCHLD in the vcpu threads works too. Not sure this is the correct fix or whenever it just papers over the underlying bug.
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release. Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release. This request is not yet committed for
Glauber, can you put your io-thread hat on and either comment on the possible fixes outlined in "Additional info" above or just grab this bug and handle it?
I made some comments on this bug yesterday. Somehow, they are missing, no idea why.
I am already working on it.
Ok, some more info:
It doesn't seem to happen with -no-kvm-irqchip. Investigating, I've found that after the receival of SIGCHLD, the kernel is blocked in kvm_vcpu_block. Also,
it is hardly triggable when the guest kernel hasn't reached userspace yet (probably because it halts less, during kernel boot).
The funny thing is that it never happens when one just sends SIGCHLD to the process. The signal handler is executed, but the problem does not appear.
I believe there is a race somewhere, where we consume a SIGCHLD when expecting SIG_IPI, and then this other signal is lost.
But right now, my biggest belief is that there is a race bug somewhere in the kernel, in the in-kernel apic implementation.
Ok, I now reproduce it even when disabling the SIGCHLD signal handler.
This is conforming to my theory that we have a race with sigpending status.
Patch(es) available on kernel-2.6.32-42.el6
I have tried on
# uname -r
for tens of times, and cannot reproduce this bug.
# uname -r
I can, sometimes, find the guest machine (rhel6) cannot execute commands
# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.034 ms
and cannot go on any more.
and "top", "reboot" and some other commands cannot return any thing.
anyway, I cannot reproduce this on 2.6.32-42.el6.x86_64 kernel.
# rpm -q qemu-kvm
command that starts vm:
qemu-kvm -name vm1 -monitor stdio -drive file=./RHEL-Server-6.0-64.qcow2,if=ide,cache=none,aio=native -m 2048 -smp 2 -vnc :0 -spice port=8000,disable-ticketing -usbdevice tablet -rtc-td-hack -cpu qemu64,+sse2 -no-kvm-pit-reinjection -net nic,vlan=0,netdev=DWxy,model=rtl8139,macaddr='02:6F:F6:3D:b9:b2' -netdev tap,id=DWxy,ifname=rtl8139_0_8000,script=.scripts/qemu-ifup-switch,downscript=no
command that trys to trigger this bug:
*** Bug 585195 has been marked as a duplicate of this bug. ***