All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1686390] [NEW] vnc server closed socket after arrow "down" keyevent
@ 2017-04-26 13:12 leon
  2017-04-26 14:01 ` [Qemu-devel] [Bug 1686390] " leon
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: leon @ 2017-04-26 13:12 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

This is a rewrite for https://bugs.launchpad.net/qemu/+bug/1670377

QEMU 2.6 or later
tigervncviwer 1.6  

Once get into grub boot interface(choose boot os, or recovery mode),
keep pressing arrow down button for couple times, qemu will close the
connection, vnc used zrle mode.

Interesting place:
1. when stopped at grub interface, only arrow up and down key could trigger it, 
2.  only in zrle or tight mode, could work well in raw mode
2. it only triggered by remote connection, not happen if local vncviewer and vnc server


A trace is attached.

Thanks

** Affects: qemu
     Importance: Undecided
         Status: New

** Attachment added: "qemu trace file"
   https://bugs.launchpad.net/bugs/1686390/+attachment/4868238/+files/trace.txt

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1686390

Title:
  vnc server closed socket after arrow "down" keyevent

Status in QEMU:
  New

Bug description:
  This is a rewrite for https://bugs.launchpad.net/qemu/+bug/1670377

  QEMU 2.6 or later
  tigervncviwer 1.6  

  Once get into grub boot interface(choose boot os, or recovery mode),
  keep pressing arrow down button for couple times, qemu will close the
  connection, vnc used zrle mode.

  Interesting place:
  1. when stopped at grub interface, only arrow up and down key could trigger it, 
  2.  only in zrle or tight mode, could work well in raw mode
  2. it only triggered by remote connection, not happen if local vncviewer and vnc server

  
  A trace is attached.

  Thanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1686390/+subscriptions

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [Bug 1686390] Re: vnc server closed socket after arrow "down" keyevent
  2017-04-26 13:12 [Qemu-devel] [Bug 1686390] [NEW] vnc server closed socket after arrow "down" keyevent leon
@ 2017-04-26 14:01 ` leon
  2017-04-26 14:09 ` [Qemu-devel] [Bug 1686390] [NEW] " Liang Yan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: leon @ 2017-04-26 14:01 UTC (permalink / raw)
  To: qemu-devel

** Description changed:

  This is a rewrite for https://bugs.launchpad.net/qemu/+bug/1670377
  
  QEMU 2.6 or later
- tigervncviwer 1.6  
+ tigervncviwer 1.6
  
  Once get into grub boot interface(choose boot os, or recovery mode),
- keep pressing arrow down button for couple times, qemu will close the
- connection, vnc used zrle mode.
+ keep holding press arrow down button for a while(no release), qemu will
+ close the connection, vnc used zrle mode.
  
  Interesting place:
- 1. when stopped at grub interface, only arrow up and down key could trigger it, 
+ 1. when stopped at grub interface, only arrow up and down key could trigger it,
  2.  only in zrle or tight mode, could work well in raw mode
  2. it only triggered by remote connection, not happen if local vncviewer and vnc server
- 
  
  A trace is attached.
  
  Thanks

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1686390

Title:
  vnc server closed socket after arrow "down" keyevent

Status in QEMU:
  New

Bug description:
  This is a rewrite for https://bugs.launchpad.net/qemu/+bug/1670377

  QEMU 2.6 or later
  tigervncviwer 1.6

  Once get into grub boot interface(choose boot os, or recovery mode),
  keep holding press arrow down button for a while(no release), qemu
  will close the connection, vnc used zrle mode.

  Interesting place:
  1. when stopped at grub interface, only arrow up and down key could trigger it,
  2.  only in zrle or tight mode, could work well in raw mode
  2. it only triggered by remote connection, not happen if local vncviewer and vnc server

  A trace is attached.

  Thanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1686390/+subscriptions

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [Bug 1686390] [NEW] vnc server closed socket after arrow "down" keyevent
  2017-04-26 13:12 [Qemu-devel] [Bug 1686390] [NEW] vnc server closed socket after arrow "down" keyevent leon
  2017-04-26 14:01 ` [Qemu-devel] [Bug 1686390] " leon
@ 2017-04-26 14:09 ` Liang Yan
  2017-04-27 13:59 ` [Qemu-devel] [Bug 1686390] " leon
  2017-04-27 14:10 ` Daniel Berrange
  3 siblings, 0 replies; 5+ messages in thread
From: Liang Yan @ 2017-04-26 14:09 UTC (permalink / raw)
  To: qemu-devel



On 4/26/17 9:12 AM, leon wrote:
> Public bug reported:
>
> This is a rewrite for https://bugs.launchpad.net/qemu/+bug/1670377
>
> QEMU 2.6 or later
> tigervncviwer 1.6  
>
> Once get into grub boot interface(choose boot os, or recovery mode),
> keep pressing arrow down button for couple times, qemu will close the
> connection, vnc used zrle mode.
One correction is that hold pressing "down" key, and do not release it
for a while, then the connection will be closed.
>
> Interesting place:
> 1. when stopped at grub interface, only arrow up and down key could trigger it, 
> 2.  only in zrle or tight mode, could work well in raw mode
> 2. it only triggered by remote connection, not happen if local vncviewer and vnc server
According to the trace file, it looks like socket is closed right after
qio_channel_socket_writev, so it may something wrong when update fb by
zrle mode. Anyone know how to trace buffer size change?


46531@1493059183.573496:ps2_put_keycode 0x55f2943ae3b0 keycode 208
46531@1493059183.573498:system_wakeup_request reason=3
46531@1493059183.573500:kvm_vm_ioctl type 0xc008ae67, arg 0x7ffe75347160
46531@1493059183.573503:apic_report_irq_delivered coalescing 32932
46531@1493059183.573505:kvm_vm_ioctl type 0xc008ae67, arg 0x7ffe75347180
46531@1493059183.573507:apic_report_irq_delivered coalescing 32934
46531@1493059183.573509:input_event_sync
46531@1493059183.573518:buffer_resize vnc-input/0x55f293ec3c30: old
4096, new 4096
46531@1493059183.573521:object_class_dynamic_cast_assert
qio-channel-socket->qio-channel (io/channel.c:60:qio_channel_writev_full)
46531@1493059183.573524:object_dynamic_cast_assert
qio-channel-socket->qio-channel-socket
(io/channel-socket.c:508:qio_channel_socket_writev)
46531@1493059183.573528:object_class_dynamic_cast_assert
qio-channel-socket->qio-channel (io/channel.c:123:qio_channel_close)
46531@1493059183.573531:object_dynamic_cast_assert
qio-channel-socket->qio-channel-socket
(io/channel-socket.c:688:qio_channel_socket_close)

Thanks,
Liang
>
> A trace is attached.
>
> Thanks
>
> ** Affects: qemu
>      Importance: Undecided
>          Status: New
>
> ** Attachment added: "qemu trace file"
>    https://bugs.launchpad.net/bugs/1686390/+attachment/4868238/+files/trace.txt
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [Bug 1686390] Re: vnc server closed socket after arrow "down" keyevent
  2017-04-26 13:12 [Qemu-devel] [Bug 1686390] [NEW] vnc server closed socket after arrow "down" keyevent leon
  2017-04-26 14:01 ` [Qemu-devel] [Bug 1686390] " leon
  2017-04-26 14:09 ` [Qemu-devel] [Bug 1686390] [NEW] " Liang Yan
@ 2017-04-27 13:59 ` leon
  2017-04-27 14:10 ` Daniel Berrange
  3 siblings, 0 replies; 5+ messages in thread
From: leon @ 2017-04-27 13:59 UTC (permalink / raw)
  To: qemu-devel

Find the root reason: qio_channel_write is going to write 290124 data,
but only wrote 238644, and for the next write 51489, it returned error,
then trigger vnc_client_io_error and disconnect socket.


ssize_t vnc_client_write_buf(VncState *vs, const uint8_t *data, size_t datalen)
{
    Error *err = NULL;
    ssize_t ret;
    ret = qio_channel_write(
        vs->ioc, (const char *)data, datalen, &err);
    VNC_DEBUG("Wrote wire %p %zd -> %ld\n", data, datalen, ret);
    return vnc_client_io_error(vs, ret, &err);
}

// log file


Write Plain: Pending output 0x5579e6bd2c60 size 524288 offset 290124. Wait SSF 0
32760@1493228975.268871:object_class_dynamic_cast_assert qio-channel-socket->qio-channel (io/channel.c:60:qio_channel_writev_full)
32760@1493228975.268876:object_dynamic_cast_assert qio-channel-socket->qio-channel-socket (io/channel-socket.c:508:qio_channel_socket_writev)
Wrote wire 0x5579e6bd2c60 290124 -> 290124


Write Plain: Pending output 0x5579e6bd2c60 size 524288 offset 290124. Wait SSF 0
32760@1493228975.731842:object_class_dynamic_cast_assert qio-channel-socket->qio-channel (io/channel.c:60:qio_channel_writev_full)
32760@1493228975.731846:object_dynamic_cast_assert qio-channel-socket->qio-channel-socket (io/channel-socket.c:508:qio_channel_socket_writev)
Wrote wire 0x5579e6bd2c60 290124 -> 238644
Write Plain: Pending output 0x5579e6bd2c60 size 65536 offset 51480. Wait SSF 0
32760@1493228975.731934:object_class_dynamic_cast_assert qio-channel-socket->qio-channel (io/channel.c:60:qio_channel_writev_full)
32760@1493228975.731937:object_dynamic_cast_assert qio-channel-socket->qio-channel-socket (io/channel-socket.c:508:qio_channel_socket_writev)
Wrote wire 0x5579e6bd2c60 51480 -> -2
vnc_set_share_mode/0x5579e7b6d730: shared -> disconnected

** Changed in: qemu
     Assignee: (unassigned) => leon (liayan)

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1686390

Title:
  vnc server closed socket after arrow "down" keyevent

Status in QEMU:
  New

Bug description:
  This is a rewrite for https://bugs.launchpad.net/qemu/+bug/1670377

  QEMU 2.6 or later
  tigervncviwer 1.6

  Once get into grub boot interface(choose boot os, or recovery mode),
  keep holding press arrow down button for a while(no release), qemu
  will close the connection, vnc used zrle mode.

  Interesting place:
  1. when stopped at grub interface, only arrow up and down key could trigger it,
  2.  only in zrle or tight mode, could work well in raw mode
  2. it only triggered by remote connection, not happen if local vncviewer and vnc server

  A trace is attached.

  Thanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1686390/+subscriptions

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [Bug 1686390] Re: vnc server closed socket after arrow "down" keyevent
  2017-04-26 13:12 [Qemu-devel] [Bug 1686390] [NEW] vnc server closed socket after arrow "down" keyevent leon
                   ` (2 preceding siblings ...)
  2017-04-27 13:59 ` [Qemu-devel] [Bug 1686390] " leon
@ 2017-04-27 14:10 ` Daniel Berrange
  3 siblings, 0 replies; 5+ messages in thread
From: Daniel Berrange @ 2017-04-27 14:10 UTC (permalink / raw)
  To: qemu-devel

>  Wrote wire 0x5579e6bd2c60 51480 -> -2

That is QIO_CHANNEL_ERR_BLOCK, aka EAGAIN.

This is fixed in the 2.9.0 release with

commit 537848ee62195fc06c328b1cd64f4218f404a7f1
Author: Michael Tokarev <mjt@tls.msk.ru>
Date:   Fri Feb 3 12:52:29 2017 +0300

    vnc: do not disconnect on EAGAIN
    
    When qemu vnc server is trying to send large update to clients,
    there might be a situation when system responds with something
    like EAGAIN, indicating that there's no system memory to send
    that much data (depending on the network speed, client and server
    and what is happening).  In this case, something like this happens
    on qemu side (from strace):
    
    sendmsg(16, {msg_name(0)=NULL,
            msg_iov(1)=[{"\244\"..., 729186}],
            msg_controllen=0, msg_flags=0}, 0) = 103950
    sendmsg(16, {msg_name(0)=NULL,
            msg_iov(1)=[{"lz\346"..., 1559618}],
            msg_controllen=0, msg_flags=0}, 0) = -1 EAGAIN
    sendmsg(-1, {msg_name(0)=NULL,
            msg_iov(1)=[{"lz\346"..., 1559618}],
            msg_controllen=0, msg_flags=0}, 0) = -1 EBADF
    
    qemu closes the socket before the retry, and obviously it gets EBADF
    when trying to send to -1.
    
    This is because there WAS a special handling for EAGAIN, but now it doesn't
    work anymore, after commit 04d2529da27db512dcbd5e99d0e26d333f16efcc, because
    now in all error-like cases we initiate vnc disconnect.
    
    This change were introduced in qemu 2.6, and caused numerous grief for many
    people, resulting in their vnc clients reporting sporadic random disconnects
    from vnc server.
    
    Fix that by doing the disconnect only when necessary, i.e. omitting this
    very case of EAGAIN.
    
    Hopefully the existing condition (comparing with QIO_CHANNEL_ERR_BLOCK)
    is sufficient, as the original code (before the above commit) were
    checking for other errno values too.
    
    Apparently there's another (semi?)bug exist somewhere here, since the
    code tries to write to fd# -1, it probably should check if the connection
    is open before. But this isn't important.
    
    Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
    Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
    Message-id: 1486115549-9398-1-git-send-email-mjt@msgid.tls.msk.ru
    Fixes: 04d2529da27db512dcbd5e99d0e26d333f16efcc
    Cc: Daniel P. Berrange <berrange@redhat.com>
    Cc: Gerd Hoffmann <kraxel@redhat.com>
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


** Changed in: qemu
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1686390

Title:
  vnc server closed socket after arrow "down" keyevent

Status in QEMU:
  Fix Released

Bug description:
  This is a rewrite for https://bugs.launchpad.net/qemu/+bug/1670377

  QEMU 2.6 or later
  tigervncviwer 1.6

  Once get into grub boot interface(choose boot os, or recovery mode),
  keep holding press arrow down button for a while(no release), qemu
  will close the connection, vnc used zrle mode.

  Interesting place:
  1. when stopped at grub interface, only arrow up and down key could trigger it,
  2.  only in zrle or tight mode, could work well in raw mode
  2. it only triggered by remote connection, not happen if local vncviewer and vnc server

  A trace is attached.

  Thanks

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1686390/+subscriptions

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-27 14:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-26 13:12 [Qemu-devel] [Bug 1686390] [NEW] vnc server closed socket after arrow "down" keyevent leon
2017-04-26 14:01 ` [Qemu-devel] [Bug 1686390] " leon
2017-04-26 14:09 ` [Qemu-devel] [Bug 1686390] [NEW] " Liang Yan
2017-04-27 13:59 ` [Qemu-devel] [Bug 1686390] " leon
2017-04-27 14:10 ` Daniel Berrange

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.