From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nnpmi-0000Vb-DV for qemu-devel@nongnu.org; Sat, 06 Mar 2010 03:54:56 -0500 Received: from [199.232.76.173] (port=34261 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nnpmi-0000VR-29 for qemu-devel@nongnu.org; Sat, 06 Mar 2010 03:54:56 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nnpmg-0004lC-Ka for qemu-devel@nongnu.org; Sat, 06 Mar 2010 03:54:55 -0500 Received: from alpha.arachsys.com ([91.203.57.7]:46275) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nnpmg-0004ku-Br for qemu-devel@nongnu.org; Sat, 06 Mar 2010 03:54:54 -0500 Date: Sat, 6 Mar 2010 08:53:32 +0000 From: Chris Webb Subject: Re: [Qemu-devel] Re: Another VNC crash, qemu-kvm-0.12.3 Message-ID: <20100306085332.GF7180@arachsys.com> References: <20100221172358.GH4894@arachsys.com> <4B82462A.7050903@redhat.com> <4B82F8ED.6000303@codemonkey.ws> <20100301181416.GB15908@arachsys.com> <4B8E70DB.4080108@codemonkey.ws> <20100305165209.GL29711@arachsys.com> <5C5C4645-0DDF-47C9-A656-6F5F403367C3@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5C5C4645-0DDF-47C9-A656-6F5F403367C3@suse.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Alexander Graf 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.