From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ztoc1-0006KG-Le for qemu-devel@nongnu.org; Tue, 03 Nov 2015 22:19:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ztoby-0004u4-GD for qemu-devel@nongnu.org; Tue, 03 Nov 2015 22:19:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ztoby-0004u0-BM for qemu-devel@nongnu.org; Tue, 03 Nov 2015 22:19:46 -0500 References: <5638B041.50500@huawei.com> <56396C66.4000303@huawei.com> From: Jason Wang Message-ID: <5639794D.9030109@redhat.com> Date: Wed, 4 Nov 2015 11:19:41 +0800 MIME-Version: 1.0 In-Reply-To: <56396C66.4000303@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [vhost-user BUG ?] QEMU process segfault when shutdown or reboot with vhost-user List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: zhanghailiang , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: "Michael S. Tsirkin" , peter.huangpeng@huawei.com, "stefanha@redhat.com" , "qemu-devel@nongnu.org" On 11/04/2015 10:24 AM, zhanghailiang wrote: > On 2015/11/3 22:54, Marc-Andr=C3=A9 Lureau wrote: >> Hi >> >> On Tue, Nov 3, 2015 at 2:01 PM, zhanghailiang >> wrote: >>> The corresponding codes where gdb reports error are: (We have added >>> some >>> codes in net.c) >> >> Can you reproduce with unmodified qemu? Could you give instructions >> to do so? >> > > OK, i will try to do it. There is nothing special, we run iperf tool > in VM, > and then shutdown or reboot it. There is change you can catch segfault. > >>> ssize_t qemu_deliver_packet(NetClientState *sender, >>> unsigned flags, >>> const uint8_t *data, >>> size_t size, >>> void *opaque) >>> { >>> NetClientState *nc =3D opaque; >>> ssize_t ret; >>> >>> if (nc->link_down) { >>> return size; >>> } >>> >>> if (nc->receive_disabled) { >>> return 0; >>> } >>> >>> if (flags & QEMU_NET_PACKET_FLAG_RAW && nc->info->receive_raw) { >>> ret =3D nc->info->receive_raw(nc, data, size); >>> } else { >>> ret =3D nc->info->receive(nc, data, size); ----> Here is >>> 510 line >>> } >>> >>> I'm not quite familiar with vhost-user, but for vhost-user, these two >>> callback functions seem to be always NULL, >>> Why we can come here ? >> >> You should not come here, vhost-user has nc->receive_disabled (it >> changes in 2.5) >> > > I have looked at the newest codes, i think we can still have chance to > come here, since we will change nc->receive_disable to false > temporarily in > qemu_flush_or_purge_queued_packets(), there is no difference between > 2.3 and 2.5 > for this. > Besides, is it possible for !QTAILQ_EMPTY(&queue->packets) to be true > in qemu_net_queue_flush() for vhost-user ? The only thing I can image is self announcing. Are you trying to do migration? 2.5 only support sending rarp through this. And it's better to have a breakpoint to see why a packet was queued for vhost-user. The stack trace may also help in this case. > > i will try to reproduce it by using newest qemu. > > Thanks, > zhanghailiang >