qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Chris Webb <chris@arachsys.com>
To: Alexander Graf <agraf@suse.de>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: Re: [Qemu-devel] Re: Another VNC crash, qemu-kvm-0.12.3
Date: Sat, 6 Mar 2010 08:53:32 +0000	[thread overview]
Message-ID: <20100306085332.GF7180@arachsys.com> (raw)
In-Reply-To: <5C5C4645-0DDF-47C9-A656-6F5F403367C3@suse.de>

Alexander Graf <agraf@suse.de> writes:

> On 05.03.2010, at 17:52, Chris Webb wrote:
>
> > Of course, if the screen width or height is 1, it doesn't really matter what
> > the value of the mouse position for the click is, so something as simple as
> > 
> > diff --git a/vnc.c b/vnc.c
> > --- a/vnc.c
> > +++ b/vnc.c
> > @@ -1421,8 +1421,10 @@
> >         dz = 1;
> > 
> >     if (vs->absolute) {
> > -        kbd_mouse_event(x * 0x7FFF / (ds_get_width(vs->ds) - 1),
> > -                        y * 0x7FFF / (ds_get_height(vs->ds) - 1),
> > +        kbd_mouse_event(ds_get_width(vs->ds) > 1 ?
> > +                          x * 0x7FFF / (ds_get_width(vs->ds) - 1) : 0x4000,
> > +                        ds_get_height(vs->ds) > 1 ?
> > +                          y * 0x7FFF / (ds_get_height(vs->ds) - 1) : 0x4000,
> >                         dz, buttons);
> >     } else if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE)) {
> >         x -= 0x7FFF;
> > 
> > will fix the symptom: the division by zero. The underlying cause of a 9x1
> > display surface is a bit mysterious though.
> 
> Is it? When booting the screen gets resized to something like 9x1 for a
> few ms. Try putting debug code in the resize callback - you'll see it.

Ah, okay. In that case, this patch could well be the correct fix rather than
just a work-around. I'll have a look for any other places in vnc.c that
might do a similar division-by-zero for small screen sizes at the same
point.

Best wishes,

Chris.

  reply	other threads:[~2010-03-06  8:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-21 17:23 [Qemu-devel] qemu-kvm 0.12.2 VNC segfault Chris Webb
2010-02-22  8:54 ` [Qemu-devel] " Avi Kivity
2010-02-22 19:06   ` Chris Webb
2010-02-22 21:36   ` Anthony Liguori
2010-03-01 18:14     ` [Qemu-devel] Another VNC crash, qemu-kvm-0.12.3 Chris Webb
2010-03-03 14:23       ` [Qemu-devel] " Anthony Liguori
2010-03-05 16:52         ` Chris Webb
2010-03-05 19:57           ` Alexander Graf
2010-03-06  8:53             ` Chris Webb [this message]
2010-03-08 14:34               ` [Qemu-devel] [PATCH] Fix SIGFPE for vnc display of width/height = 1 Chris Webb
2010-03-08 18:15                 ` Chris Webb
2010-03-17 15:59                 ` Anthony Liguori
2010-03-17 16:55                   ` Alexander Graf

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=20100306085332.GF7180@arachsys.com \
    --to=chris@arachsys.com \
    --cc=agraf@suse.de \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /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).