Received: from eggs.gnu.org ([140.186.70.92]:38962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSp4w-0000JO-62 for qemu-devel@nongnu.org; Tue, 22 Nov 2011 07:04:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSp4g-0003zy-Lc for qemu-devel@nongnu.org; Tue, 22 Nov 2011 07:03:58 -0500 Received: from cantor2.suse.de ([195.135.220.15]:54317 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSp4g-0003z0-Ds for qemu-devel@nongnu.org; Tue, 22 Nov 2011 07:03:42 -0500 Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <20110929160646.GA16909@amit-x200.redhat.com> Date: Tue, 22 Nov 2011 13:03:36 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <41F37DA2-446F-416D-AD88-7F49C7E82B28@suse.de> References: <1ab74cea060d776b19857c3babc64d729bbdba5c.1312370658.git.jan.kiszka@siemens.com> <20110929160646.GA16909@amit-x200.redhat.com> Subject: Re: [Qemu-devel] [PATCH 3/3] Delayed IP packets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Lukas Doktor , Anthony Liguori , Jan Kiszka , qemu-devel Developers , Fabien Chouteau , Blue Swirl On 29.09.2011, at 18:06, Amit Shah wrote: > On (Wed) 03 Aug 2011 [13:24:22], Jan Kiszka wrote: >> From: Fabien Chouteau >>=20 >> In the current implementation, if Slirp tries to send an IP packet to = a client >> with an unknown hardware address, the packet is simply dropped and an = ARP >> request is sent (if_encap in slirp/slirp.c). >>=20 >> With this patch, Slirp will send the ARP request, re-queue the packet = and try >> to send it later. The packet is dropped after one second if the ARP = reply is >> not received. >=20 > This patch causes a segfault when guests wake up from hibernate. >=20 > Recipe: > 1. Start guest with -net user -net nic,model=3Dvirtio > 2. (guest) ping 10.0.2.2 > 3. (guest) echo "disk" > /sys/power/state > 4. Re-start guest with same command line > 5. Ping has stopped receiving replies. > 6. Kill that ping process and start a new one. qemu segfaults. >=20 > This needs the not-upstream-yet virtio S4 handling patches, found at > http://thread.gmane.org/gmane.linux.kernel/1197141 >=20 > The backtrace is: >=20 > (gdb) bt > #0 0x00007ffff7e421f7 in slirp_insque (a=3D0x0, b=3D0x7ffff8f95d50) = at > /home/amit/src/qemu/slirp/misc.c:27 > #1 0x00007ffff7e40738 in if_start (slirp=3D0x7ffff8a9cdf0) at > /home/amit/src/qemu/slirp/if.c:194 > #2 0x00007ffff7e44828 in slirp_select_poll (readfds=3D0x7fffffffd930, > writefds=3D0x7fffffffd9b0, xfds=3D0x7fffffffda30, select_error=3D0) > at /home/amit/src/qemu/slirp/slirp.c:588 > #3 0x00007ffff7e110f1 in main_loop_wait (nonblocking=3D) > at /home/amit/src/qemu/vl.c:1549 > #4 0x00007ffff7d7dc47 in main_loop () at > /home/amit/src/qemu/vl.c:1579 > #5 main (argc=3D, argv=3D, = envp=3D out>) at /home/amit/src/qemu/vl.c:3574 >=20 >=20 > Reverting the patch keeps the ping going on after resume. =20 I get the same thing with yesterday's HEAD (close to 1.0-rc3), but = without hibernation. I'm running KVM Autotest on PPC machines to check my ppc-next queue and = every single test failed for me because of segmentation faults in the = slirp code. Reverting this patch (and the follow-up patch which fixes = the struct mbuf definition) makes all tests not segfault for me, so I'm = fairly sure this is the offending one :). I'm not saying that the patch is actually wrong - maybe it only exposes = another bug that was only hidden so far. Either way, the breakage looks = pretty much like memory corruption to me. Also, I'm having a hard time reproducing the problem manually. It = triggers every time in Autotest, but never when I try to trigger it = manually. Essentially Autotest is merely trying to connect to the guest = using ssh every couple of seconds, so I don't know why I can't reproduce = it without it. Please fix or revert this for 1.0. Alex