From: "Zhanghaoyu (A)" <haoyu.zhang@huawei.com> To: Gerd Hoffmann <kraxel@redhat.com>, Stefan Hajnoczi <stefanha@gmail.com> Cc: "Huangweidong (C)" <weidong.huang@huawei.com>, kvm list <kvm@vger.kernel.org>, Marcelo Tosatti <mtosatti@redhat.com>, Luonengjun <luonengjun@huawei.com>, qemu-devel <qemu-devel@nongnu.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Zanghongyong <zanghongyong@huawei.com>, Zhanghuanzhong <zhanghuanzhong@huawei.com>, "corentin.chary@gmail.com" <corentin.chary@gmail.com> Subject: reply: [Qemu-devel] reply: reply: qemu crashed when starting vm(kvm) with vnc connect Date: Thu, 18 Apr 2013 11:19:54 +0000 [thread overview] Message-ID: <D3E216785288A145B7BC975F83A2ED103FE1E610@szxeml556-mbx.china.huawei.com> (raw) In-Reply-To: <516FBBF7.1080400@redhat.com> > > On Mon, Apr 08, 2013 at 12:27:06PM +0000, Zhanghaoyu (A) wrote: > >> On Sun, Apr 07, 2013 at 04:58:07AM +0000, Zhanghaoyu (A) wrote: > >>>>>> I start a kvm VM with vnc(using the zrle protocol) connect, sometimes qemu program crashed during starting period, received signal SIGABRT. > >>>>>> Trying about 20 times, this crash may be reproduced. > >>>>>> I guess the cause memory corruption or double free. > >>>>> > >>>>> Which version of QEMU are you running? > >>>>> > >>>>> Please try qemu.git/master. > > Please try again with latest master, might be fixed meanwhile. > > If it still happens pleas provide full qemu and vnc client command lines. > > >> backtrace from core file is shown as below: > >> > >> Program received signal SIGABRT, Aborted. > > >> #8 0x00007f32efd26d07 in vnc_disconnect_finish (vs=0x7f32f0c762d0) > >> at ui/vnc.c:1050 > > Do you have a vnc client connected? Do you close it? > I have a vnc client connected, it was auto closed while qemu crashed. > Any errors reported by the vnc client (maybe it disconnects due to an error in the data stream)? > No errors reported by the vnc client, just popup a reconnect window. And, I have tried to fix this bug, not reproduce this crash after tried about 100 times, patch is shown as below, --- a/ui/vnc-jobs.c 2013-04-18 20:10:07.000000000 +0800 +++ b/ui/vnc-jobs.c 2013-04-18 20:14:06.000000000 +0800 @@ -234,7 +234,6 @@ static int vnc_worker_thread_loop(VncJob vnc_unlock_output(job->vs); goto disconnected; } - vnc_unlock_output(job->vs); /* Make a local copy of vs and switch output buffers */ vnc_async_encoding_start(job->vs, &vs); @@ -252,6 +251,8 @@ static int vnc_worker_thread_loop(VncJob if (job->vs->csock == -1) { vnc_unlock_display(job->vs->vd); + vnc_async_encoding_end(job->vs, &vs); + vnc_unlock_output(job->vs); goto disconnected; } @@ -269,7 +270,6 @@ static int vnc_worker_thread_loop(VncJob vs.output.buffer[saved_offset] = (n_rectangles >> 8) & 0xFF; vs.output.buffer[saved_offset + 1] = n_rectangles & 0xFF; - vnc_lock_output(job->vs); if (job->vs->csock != -1) { buffer_reserve(&job->vs->jobs_buffer, vs.output.offset); buffer_append(&job->vs->jobs_buffer, vs.output.buffer, @@ -278,6 +278,8 @@ static int vnc_worker_thread_loop(VncJob vnc_async_encoding_end(job->vs, &vs); qemu_bh_schedule(job->vs->bh); + } else { + vnc_async_encoding_end(job->vs, &vs); } vnc_unlock_output(job->vs); Thanks, Zhang Haoyu
WARNING: multiple messages have this Message-ID (diff)
From: "Zhanghaoyu (A)" <haoyu.zhang@huawei.com> To: Gerd Hoffmann <kraxel@redhat.com>, Stefan Hajnoczi <stefanha@gmail.com> Cc: "Huangweidong (C)" <weidong.huang@huawei.com>, kvm list <kvm@vger.kernel.org>, Marcelo Tosatti <mtosatti@redhat.com>, Luonengjun <luonengjun@huawei.com>, qemu-devel <qemu-devel@nongnu.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Zanghongyong <zanghongyong@huawei.com>, Zhanghuanzhong <zhanghuanzhong@huawei.com>, "corentin.chary@gmail.com" <corentin.chary@gmail.com> Subject: [Qemu-devel] reply: reply: reply: qemu crashed when starting vm(kvm) with vnc connect Date: Thu, 18 Apr 2013 11:19:54 +0000 [thread overview] Message-ID: <D3E216785288A145B7BC975F83A2ED103FE1E610@szxeml556-mbx.china.huawei.com> (raw) In-Reply-To: <516FBBF7.1080400@redhat.com> > > On Mon, Apr 08, 2013 at 12:27:06PM +0000, Zhanghaoyu (A) wrote: > >> On Sun, Apr 07, 2013 at 04:58:07AM +0000, Zhanghaoyu (A) wrote: > >>>>>> I start a kvm VM with vnc(using the zrle protocol) connect, sometimes qemu program crashed during starting period, received signal SIGABRT. > >>>>>> Trying about 20 times, this crash may be reproduced. > >>>>>> I guess the cause memory corruption or double free. > >>>>> > >>>>> Which version of QEMU are you running? > >>>>> > >>>>> Please try qemu.git/master. > > Please try again with latest master, might be fixed meanwhile. > > If it still happens pleas provide full qemu and vnc client command lines. > > >> backtrace from core file is shown as below: > >> > >> Program received signal SIGABRT, Aborted. > > >> #8 0x00007f32efd26d07 in vnc_disconnect_finish (vs=0x7f32f0c762d0) > >> at ui/vnc.c:1050 > > Do you have a vnc client connected? Do you close it? > I have a vnc client connected, it was auto closed while qemu crashed. > Any errors reported by the vnc client (maybe it disconnects due to an error in the data stream)? > No errors reported by the vnc client, just popup a reconnect window. And, I have tried to fix this bug, not reproduce this crash after tried about 100 times, patch is shown as below, --- a/ui/vnc-jobs.c 2013-04-18 20:10:07.000000000 +0800 +++ b/ui/vnc-jobs.c 2013-04-18 20:14:06.000000000 +0800 @@ -234,7 +234,6 @@ static int vnc_worker_thread_loop(VncJob vnc_unlock_output(job->vs); goto disconnected; } - vnc_unlock_output(job->vs); /* Make a local copy of vs and switch output buffers */ vnc_async_encoding_start(job->vs, &vs); @@ -252,6 +251,8 @@ static int vnc_worker_thread_loop(VncJob if (job->vs->csock == -1) { vnc_unlock_display(job->vs->vd); + vnc_async_encoding_end(job->vs, &vs); + vnc_unlock_output(job->vs); goto disconnected; } @@ -269,7 +270,6 @@ static int vnc_worker_thread_loop(VncJob vs.output.buffer[saved_offset] = (n_rectangles >> 8) & 0xFF; vs.output.buffer[saved_offset + 1] = n_rectangles & 0xFF; - vnc_lock_output(job->vs); if (job->vs->csock != -1) { buffer_reserve(&job->vs->jobs_buffer, vs.output.offset); buffer_append(&job->vs->jobs_buffer, vs.output.buffer, @@ -278,6 +278,8 @@ static int vnc_worker_thread_loop(VncJob vnc_async_encoding_end(job->vs, &vs); qemu_bh_schedule(job->vs->bh); + } else { + vnc_async_encoding_end(job->vs, &vs); } vnc_unlock_output(job->vs); Thanks, Zhang Haoyu
next prev parent reply other threads:[~2013-04-18 11:20 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-04-02 9:02 qemu crashed when starting vm(kvm) with vnc connect Zhanghaoyu (A) 2013-04-02 9:02 ` [Qemu-devel] " Zhanghaoyu (A) 2013-04-05 6:34 ` Stefan Hajnoczi 2013-04-05 6:34 ` Stefan Hajnoczi 2013-04-07 4:58 ` 答复: " Zhanghaoyu (A) 2013-04-07 4:58 ` [Qemu-devel] " Zhanghaoyu (A) 2013-04-08 10:50 ` 答复: [Qemu-devel] " Stefan Hajnoczi 2013-04-08 10:50 ` [Qemu-devel] 答复: " Stefan Hajnoczi 2013-04-08 12:27 ` reply: reply: [Qemu-devel] " Zhanghaoyu (A) 2013-04-08 12:27 ` [Qemu-devel] reply: reply: " Zhanghaoyu (A) 2013-04-11 9:29 ` Stefan Hajnoczi 2013-04-11 9:29 ` Stefan Hajnoczi 2013-04-18 9:25 ` [Qemu-devel] " Gerd Hoffmann 2013-04-18 9:25 ` Gerd Hoffmann 2013-04-18 9:25 ` Gerd Hoffmann 2013-04-18 11:19 ` Zhanghaoyu (A) [this message] 2013-04-18 11:19 ` [Qemu-devel] reply: " Zhanghaoyu (A)
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=D3E216785288A145B7BC975F83A2ED103FE1E610@szxeml556-mbx.china.huawei.com \ --to=haoyu.zhang@huawei.com \ --cc=corentin.chary@gmail.com \ --cc=kraxel@redhat.com \ --cc=kvm@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=luonengjun@huawei.com \ --cc=mtosatti@redhat.com \ --cc=qemu-devel@nongnu.org \ --cc=stefanha@gmail.com \ --cc=weidong.huang@huawei.com \ --cc=zanghongyong@huawei.com \ --cc=zhanghuanzhong@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.