From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1vM2-0005rs-Lw for qemu-devel@nongnu.org; Mon, 08 Jun 2015 07:36:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z1vLz-0000xg-44 for qemu-devel@nongnu.org; Mon, 08 Jun 2015 07:36:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1vLy-0000wl-W0 for qemu-devel@nongnu.org; Mon, 08 Jun 2015 07:36:31 -0400 Message-ID: <1433763388.5046.32.camel@redhat.com> From: Gerd Hoffmann Date: Mon, 08 Jun 2015 13:36:28 +0200 In-Reply-To: <20150608093125.GF30104@stefanha-thinkpad.redhat.com> References: <3a37931fe0e17adc26bdaa23e33f0aa8.squirrel@gator4003.hostgator.com> <20150608093125.GF30104@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] segfault in memcmp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: perrier vincent , qemu-devel@nongnu.org On Mo, 2015-06-08 at 10:31 +0100, Stefan Hajnoczi wrote: > On Fri, Jun 05, 2015 at 05:19:53PM -0500, perrier vincent wrote: > > Using a very old guest (lenny) with spice and vga=cirrus, I have > > a segfault: Hmm, doesn't reproduce on master (booting i386 lenny install iso). Which qemu version is this? > > FILE: ui/spice-display.c > > FUNCTION: qemu_spice_create_update > > LINE: if (memcmp(guest + yoff + xoff, > > mirror + yoff + xoff, > > bw * bpp) == 0) > > > > The address of mirror + yoff + xoff is out of boundaries. > > > > I use the following to avoid the crash: > > > > ... > > img_get_stride = pixman_image_get_stride(ssd->mirror); > > img_height = pixman_image_get_height(ssd->mirror); > > img_max = img_height * img_get_stride; > > ... > > if (yoff > img_max) > > { > > if (dirty_top[blk] == -1) > > dirty_top[blk] = y; > > } I'm wondering how you end up with yoff being ouf of boundaries in the first place ... cheers, Gerd