qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: zhanghailiang <zhang.zhanghailiang@huawei.com>,
	"Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	peter.huangpeng@huawei.com,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [vhost-user BUG ?] QEMU process segfault when shutdown or reboot with vhost-user
Date: Wed, 4 Nov 2015 11:19:41 +0800	[thread overview]
Message-ID: <5639794D.9030109@redhat.com> (raw)
In-Reply-To: <56396C66.4000303@huawei.com>



On 11/04/2015 10:24 AM, zhanghailiang wrote:
> On 2015/11/3 22:54, Marc-André Lureau wrote:
>> Hi
>>
>> On Tue, Nov 3, 2015 at 2:01 PM, zhanghailiang
>> <zhang.zhanghailiang@huawei.com> 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 = 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 = nc->info->receive_raw(nc, data, size);
>>>      } else {
>>>          ret = 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
>

  reply	other threads:[~2015-11-04  3:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 13:01 [Qemu-devel] [vhost-user BUG ?] QEMU process segfault when shutdown or reboot with vhost-user zhanghailiang
2015-11-03 14:54 ` Marc-André Lureau
2015-11-04  2:24   ` zhanghailiang
2015-11-04  3:19     ` Jason Wang [this message]
2015-11-04  8:12       ` zhanghailiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5639794D.9030109@redhat.com \
    --to=jasowang@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=mst@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).