Bugzilla will be upgraded to version 5.0 on December 2, 2018. The outage period for the upgrade will start at 0:00 UTC and have a duration of 12 hours
Bug 601192 - fork causes trouble for vcpu threads
fork causes trouble for vcpu threads
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Glauber Costa
Virtualization Bugs
:
: 585195 (view as bug list)
Depends On:
Blocks: 579026 606953
  Show dependency treegraph
 
Reported: 2010-06-07 08:42 EDT by Gerd Hoffmann
Modified: 2013-01-09 17:41 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 606953 (view as bug list)
Environment:
Last Closed: 2010-07-08 22:10:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gerd Hoffmann 2010-06-07 08:42:34 EDT
Description of problem:
Guest stops running when qemu receives SIGCHILD.

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.69.el6.x86_64

How reproducible:
(1) boot guest
(2) make qemu fork+exec something which exits quicky.
    "netdev_add tap,id=foo,script=/bin/true" will do.
  
Actual results:
Guest stops running.

Expected results:
Guest continues running.

Additional info:
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.
Comment 2 RHEL Product and Program Management 2010-06-07 13:03:19 EDT
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
inclusion.
Comment 3 Gerd Hoffmann 2010-06-08 04:58:16 EDT
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?
Comment 4 Glauber Costa 2010-06-08 13:47:38 EDT
Gerd,

I made some comments on this bug yesterday. Somehow, they are missing, no idea why.
I am already working on it.
Comment 5 Glauber Costa 2010-06-10 14:48:00 EDT
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.
Comment 6 Glauber Costa 2010-06-10 15:45:03 EDT
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.
Comment 7 Aristeu Rozanski 2010-07-01 12:23:13 EDT
Patch(es) available on kernel-2.6.32-42.el6
Comment 10 Cao, Chen 2010-07-05 08:07:22 EDT
I have tried on 
# uname -r
2.6.32-42.el6.x86_64

for tens of times, and cannot reproduce this bug.


but on
# uname -r
2.6.32-39.el6.x86_64

I can, sometimes, find the guest machine (rhel6) cannot execute commands
completely, i.e.
#  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.


Additional info:
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.90.el6.x86_64

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:
netdev_add tap,id=foo,script=/bin/true
Comment 11 Dor Laor 2010-07-12 05:31:44 EDT
*** Bug 585195 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.