From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Eli Zaretskii" Newsgroups: gmane.emacs.devel Subject: Re: display word wrapping Date: Sun, 30 May 2004 20:27:40 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <9003-Sun30May2004202740+0300-eliz@gnu.org> References: <20040530002547.6961.LEKTU@mi.madritel.es> <20040530175117.C69B.LEKTU@mi.madritel.es> Reply-To: Eli Zaretskii NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1085938250 10534 80.91.224.253 (30 May 2004 17:30:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 30 May 2004 17:30:50 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun May 30 19:30:42 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BUU8w-0005U5-00 for ; Sun, 30 May 2004 19:30:42 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BUU8v-0008Ir-00 for ; Sun, 30 May 2004 19:30:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BUU94-0008Jy-Av for emacs-devel@quimby.gnus.org; Sun, 30 May 2004 13:30:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BUU8z-0008J6-Ar for emacs-devel@gnu.org; Sun, 30 May 2004 13:30:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BUU8w-0008Ib-Em for emacs-devel@gnu.org; Sun, 30 May 2004 13:30:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BUU8w-0008IY-AW for emacs-devel@gnu.org; Sun, 30 May 2004 13:30:42 -0400 Original-Received: from [192.114.186.23] (helo=aragorn.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BUU8d-0000yM-U3 for emacs-devel@gnu.org; Sun, 30 May 2004 13:30:24 -0400 Original-Received: from zaretski ([80.230.153.251]) by aragorn.inter.net.il (MOS 3.4.6-GR) with ESMTP id CZJ63488; Sun, 30 May 2004 20:30:14 +0300 (IDT) Original-To: Juanma Barranquero X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 In-reply-to: <20040530175117.C69B.LEKTU@mi.madritel.es> (message from Juanma Barranquero on Sun, 30 May 2004 18:50:27 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:24228 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24228 > Date: Sun, 30 May 2004 18:50:27 +0200 > From: Juanma Barranquero > > Yes, it is a crash. No, it fails the same way under debugging. So we are lucky ;-) > > Finally, assuming that we are talking about a crash, posting the > > detailed description of the crash (exception number, register dump, > > stack dump, etc.) here could give some further ideas. [I apologize in advance if I'm going to say things that you already know.] > When I try to load a 811-byte .gif, I get: > > Unhandled exception at 0x0106dd08 in emacs.exe: 0xC0000005: Access > violation reading location 0x00000004. This means Emacs tried to dereference an invalid pointer and read from the invalid address. Exception 0xC0000005 is Page Fault, the Windows equivalent of SIGSEGV, and the bad address is 0x4 (a.k.a. a NULL pointer). > The stack trace is: > > image_spec_value(int spec=-536870912, int key=557610632, int * found=0x00000000) Line 931 + 0x8 C > lookup_image(frame * f=0x015dbe00, int spec=-1572937664) Line 1682 C > [...] > lookup_image is calling image_spec_value with the following code: > > if (! img->background_valid) > { > bg = image_spec_value (img->spec, QCbackground, NULL); > if (!NILP (bg)) > { > img->background > = x_alloc_image_color (f, img, bg, > FRAME_BACKGROUND_PIXEL (f)); > img->background_valid = 1; > } > } > > At that point, img->spec is not valid. How exactly is img->spec invalid? Can you post the details (xtype etc.)? > Previously, img has been > initialized from spec (the arg passed to the function), so spec and > img->spec should be equal, but they aren't anymore. If you change the > call to do > > bg = image_spec_value (spec, QCbackground, NULL); > > it succeeds If you think that img->spec is somehow clobbered in between the point where it is computed and the point where image_spec_value is called, the way to see who is clobbering it is to put a data breakpoint (a.k.a. watchpoint) on img->spec, and see when that watchpoint triggers. > On optimized code, img is not on the stack, but on a register. In fact, > if I change > > struct image *img; > > to > > static struct image *img; > > Emacs works fine. If you change it to volatile struct image *img; does the problem go away as well? > So it looks like it *is* really a bug in the optimizer > code, which is clobbering a register or something like that. If the clobbered pointer is in a register, then data breakpoint will not help, but you could still do it by single-stepping the program and looking for a line in the code where the value of that register is clobbered. This could be a bit tedious, but it's simple and straightforward, and will probably reveal some real bug in the code (the possibility of a bug in the compiler's optimizer exists, but I think it's only a distant second).