GNU bug report logs -
#10164
24.0.91; Instant crash enabling linum-mode
Previous Next
Reported by: Tim Crews <tim.crews <at> code-affinity.com>
Date: Wed, 30 Nov 2011 05:24:01 UTC
Severity: normal
Found in version 24.0.91
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10164 in the body.
You can then email your comments to 10164 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 05:24:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Tim Crews <tim.crews <at> code-affinity.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 30 Nov 2011 05:24:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 12:21:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 10164 <at> debbugs.gnu.org (full text, mbox):
> Date: Tue, 29 Nov 2011 19:05:20 -0700
> From: Tim Crews <tim.crews <at> code-affinity.com>
>
> Start Emacs with runemacs -Q --no-init-file
> C-x C-f foo.txt
> M-x linum-mode
> (Emacs doesn't crash yet)
> Type anything. Emacs instantly crashes.
Arrgh! This is GCC 4.6.x "as-is" code reordering in action. Emacs
crashes here:
xassert (!row->enabled_p
|| row->mode_line_p
|| verify_row_hash (row));
Evidently, it calls verify_row_hash before it tests row->mode_line_p.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 12:30:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 10164 <at> debbugs.gnu.org (full text, mbox):
> Arrgh! This is GCC 4.6.x "as-is" code reordering in action. Emacs
> crashes here:
>
> xassert (!row->enabled_p
> || row->mode_line_p
> || verify_row_hash (row));
>
> Evidently, it calls verify_row_hash before it tests row->mode_line_p
Fixed in revision 106555 on the trunk.
Chong, I hope this is in time for the next pretest. It would be a
pity to release a pretest with such a glaring problem.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 12:40:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 10164 <at> debbugs.gnu.org (full text, mbox):
On Wed, Nov 30, 2011 at 13:29, Eli Zaretskii <eliz <at> gnu.org> wrote:
> Chong, I hope this is in time for the next pretest. It would be a
> pity to release a pretest with such a glaring problem.
But verify_row_hash does nothing except checking and returning a flag,
so the new code will never cause an assertion failure...
Juanma
=== modified file 'src/dispnew.c'
--- src/dispnew.c 2011-11-28 01:07:01 +0000
+++ src/dispnew.c 2011-11-30 12:25:09 +0000
@@ -608,9 +608,10 @@
row->glyphs[LAST_AREA]
= row->glyphs[LEFT_MARGIN_AREA] + dim.width;
}
- xassert (!row->enabled_p
- || row->mode_line_p
- || verify_row_hash (row));
+#if XASSERTS
+ if (row->enabled_p && !row->mode_line_p)
+ verify_row_hash (row));
+#endif
++row;
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 12:53:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 10164 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Date: Tue, 29 Nov 2011 19:05:20 -0700
>> From: Tim Crews <tim.crews <at> code-affinity.com>
>>
>> Start Emacs with runemacs -Q --no-init-file
>> C-x C-f foo.txt
>> M-x linum-mode
>> (Emacs doesn't crash yet)
>> Type anything. Emacs instantly crashes.
>
> Arrgh! This is GCC 4.6.x "as-is" code reordering in action. Emacs
> crashes here:
>
> xassert (!row->enabled_p
> || row->mode_line_p
> || verify_row_hash (row));
>
> Evidently, it calls verify_row_hash before it tests row->mode_line_p.
Are you sure? Without interprocedural analysis the compiler cannot know
that `verify_row_hash' does not alter row->enabled_p, so it cannot
change the evaluation order.
BTW, the argument for row_hash should be const.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 13:41:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 10164 <at> debbugs.gnu.org (full text, mbox):
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Wed, 30 Nov 2011 13:38:17 +0100
> Cc: Tim Crews <tim.crews <at> code-affinity.com>, Chong Yidong <cyd <at> gnu.org>, 10164 <at> debbugs.gnu.org
>
> But verify_row_hash does nothing except checking and returning a flag,
> so the new code will never cause an assertion failure...
*Blush*
Thanks for fixing, I somehow managed to delete the xassert itself..
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 13:55:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 10164 <at> debbugs.gnu.org (full text, mbox):
> From: Dan Nicolaescu <dann <at> gnu.org>
> Cc: Tim Crews <tim.crews <at> code-affinity.com>, 10164 <at> debbugs.gnu.org
> Date: Wed, 30 Nov 2011 07:52:40 -0500
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> Date: Tue, 29 Nov 2011 19:05:20 -0700
> >> From: Tim Crews <tim.crews <at> code-affinity.com>
> >>
> >> Start Emacs with runemacs -Q --no-init-file
> >> C-x C-f foo.txt
> >> M-x linum-mode
> >> (Emacs doesn't crash yet)
> >> Type anything. Emacs instantly crashes.
> >
> > Arrgh! This is GCC 4.6.x "as-is" code reordering in action. Emacs
> > crashes here:
> >
> > xassert (!row->enabled_p
> > || row->mode_line_p
> > || verify_row_hash (row));
> >
> > Evidently, it calls verify_row_hash before it tests row->mode_line_p.
>
> Are you sure?
How else can I explain this display from GDB:
(gdb) prow
y=0 x=0 pwid=673 a+d=12+4=16 phys=12+4=16 vis=16
used=(LMargin=0,Text=84,RMargin=0) Hash=263825844
start=0 end=0 ENA MODEL
? MODEL says that this row has its mode_line_p flag set.
Just to be sure, I ran the recipe again under GDB, setting a
breakpoint inside verify_row_hash thusly:
(gdb) break verify_row_hash if row->mode_line_p != 0
and sure enough, it breaks as soon as I turn on linum-mode, with ROW
that shows the glyphs in the mode line.
> Without interprocedural analysis the compiler cannot know
> that `verify_row_hash' does not alter row->enabled_p, so it cannot
> change the evaluation order.
I don't know. Maybe GCC does perform such an analysis. Or maybe it
decides that the result of this comparison in verify_row_hash:
row->hash == row_hash (row)
will not change even if row_hash does modify its argument ROW. Or
maybe it's a bug in GCC.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 15:03:01 GMT)
Full text and
rfc822 format available.
Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):
On Wed 30 Nov 2011, Dan Nicolaescu wrote:
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> Date: Tue, 29 Nov 2011 19:05:20 -0700
>>> From: Tim Crews <tim.crews <at> code-affinity.com>
>>>
>>> Start Emacs with runemacs -Q --no-init-file
>>> C-x C-f foo.txt
>>> M-x linum-mode
>>> (Emacs doesn't crash yet)
>>> Type anything. Emacs instantly crashes.
>>
>> Arrgh! This is GCC 4.6.x "as-is" code reordering in action. Emacs
>> crashes here:
>>
>> xassert (!row->enabled_p
>> || row->mode_line_p
>> || verify_row_hash (row));
>>
>> Evidently, it calls verify_row_hash before it tests row->mode_line_p.
>
> Are you sure? Without interprocedural analysis the compiler cannot know
> that `verify_row_hash' does not alter row->enabled_p, so it cannot
> change the evaluation order.
> BTW, the argument for row_hash should be const.
The emacs build in this bug report is configured with
system-configuration-options is a variable defined in `C source code'.
Its value is "--with-gcc (4.6) --no-opt --cflags
-ID:/devel/emacs/libs/libXpm-3.5.8/include
-ID:/devel/emacs/libs/libXpm-3.5.8/src
-ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
-ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
-ID:/devel/emacs/libs/giflib-4.1.4-1/include
-ID:/devel/emacs/libs/jpeg-6b-4/include
-ID:/devel/emacs/libs/tiff-3.8.2-1/include
-ID:/devel/emacs/libs/gnutls-2.10.1/include --ldflags
-LD:/devel/emacs/libs/gnutls-2.10.1/lib"
This does not include "-fno-omit-frame-pointer", which is known to
important for MinGW GCC 4.6. Perhaps that is the real issue here ?
AndyM
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 15:12:01 GMT)
Full text and
rfc822 format available.
Message #29 received at 10164 <at> debbugs.gnu.org (full text, mbox):
On Wed, Nov 30, 2011 at 16:01, Andy Moreton <andrewjmoreton <at> gmail.com> wrote:
> The emacs build in this bug report is configured with
[...]
> This does not include "-fno-omit-frame-pointer", which is known to
> important for MinGW GCC 4.6. Perhaps that is the real issue here ?
I see it with optimized and non-optimized builds (and the optimized
build has -fno-omit-frame-pointer).
Juanma
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 15:52:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 10164 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Dan Nicolaescu <dann <at> gnu.org>
>> Cc: Tim Crews <tim.crews <at> code-affinity.com>, 10164 <at> debbugs.gnu.org
>> Date: Wed, 30 Nov 2011 07:52:40 -0500
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> >> Date: Tue, 29 Nov 2011 19:05:20 -0700
>> >> From: Tim Crews <tim.crews <at> code-affinity.com>
>> >>
>> >> Start Emacs with runemacs -Q --no-init-file
>> >> C-x C-f foo.txt
>> >> M-x linum-mode
>> >> (Emacs doesn't crash yet)
>> >> Type anything. Emacs instantly crashes.
>> >
>> > Arrgh! This is GCC 4.6.x "as-is" code reordering in action. Emacs
>> > crashes here:
>> >
>> > xassert (!row->enabled_p
>> > || row->mode_line_p
>> > || verify_row_hash (row));
>> >
>> > Evidently, it calls verify_row_hash before it tests row->mode_line_p.
>>
>> Are you sure?
>
> How else can I explain this display from GDB:
Compiler bug?
> (gdb) prow
> y=0 x=0 pwid=673 a+d=12+4=16 phys=12+4=16 vis=16
> used=(LMargin=0,Text=84,RMargin=0) Hash=263825844
> start=0 end=0 ENA MODEL
>
> ? MODEL says that this row has its mode_line_p flag set.
>
> Just to be sure, I ran the recipe again under GDB, setting a
> breakpoint inside verify_row_hash thusly:
>
> (gdb) break verify_row_hash if row->mode_line_p != 0
>
> and sure enough, it breaks as soon as I turn on linum-mode, with ROW
> that shows the glyphs in the mode line.
>
>> Without interprocedural analysis the compiler cannot know
>> that `verify_row_hash' does not alter row->enabled_p, so it cannot
>> change the evaluation order.
>
> I don't know. Maybe GCC does perform such an analysis. Or maybe it
It can't by default, `row_hash' is in a different file, so it's not
available when compiling dispnew.c.
> decides that the result of this comparison in verify_row_hash:
>
> row->hash == row_hash (row)
>
> will not change even if row_hash does modify its argument ROW. Or
> maybe it's a bug in GCC.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 16:26:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 10164 <at> debbugs.gnu.org (full text, mbox):
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Wed, 30 Nov 2011 15:32:25 +0100
>
> On Wed, Nov 30, 2011 at 14:57, Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > You mean, you still see the crash after the change??
>
> Yes.
I see it myself.
Chong, please hold off the pretest while I debug this.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 16:30:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 10164 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> On Wed, Nov 30, 2011 at 14:57, Eli Zaretskii <eliz <at> gnu.org> wrote:
>>
>> > You mean, you still see the crash after the change??
>>
>> Yes.
>
> I see it myself.
>
> Chong, please hold off the pretest while I debug this.
I bumped the version number in the trunk before seeing this latest
message. But, I haven't made the pretest tag yet---will wait.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 16:36:02 GMT)
Full text and
rfc822 format available.
Message #41 received at 10164 <at> debbugs.gnu.org (full text, mbox):
Chong Yidong <cyd <at> gnu.org> writes:
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>>> On Wed, Nov 30, 2011 at 14:57, Eli Zaretskii <eliz <at> gnu.org> wrote:
>>>
>>> > You mean, you still see the crash after the change??
>>>
>>> Yes.
>>
>> I see it myself.
>>
>> Chong, please hold off the pretest while I debug this.
>
> I bumped the version number in the trunk before seeing this latest
> message. But, I haven't made the pretest tag yet---will wait.
And FWIW, this bug seems to be Windows-only, since I don't see any crash
on GNU/Linux.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 16:41:01 GMT)
Full text and
rfc822 format available.
Message #44 received at 10164 <at> debbugs.gnu.org (full text, mbox):
> And FWIW, this bug seems to be Windows-only, since I don't see any crash
> on GNU/Linux.
How do you test it? I get the crash with
emacs -Q
M-x linum-mode <RET>
but not with
emacs -Q -f linum-mode
Juanma
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 16:43:02 GMT)
Full text and
rfc822 format available.
Message #47 received at 10164 <at> debbugs.gnu.org (full text, mbox):
Juanma Barranquero <lekktu <at> gmail.com> writes:
>> And FWIW, this bug seems to be Windows-only, since I don't see any crash
>> on GNU/Linux.
>
> How do you test it? I get the crash with
>
> emacs -Q
> M-x linum-mode <RET>
>
> but not with
>
> emacs -Q -f linum-mode
Disregard that---I had accidentally recompiled without asserts enabled.
I see the abort now.
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Wed, 30 Nov 2011 16:58:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Tim Crews <tim.crews <at> code-affinity.com>
:
bug acknowledged by developer.
(Wed, 30 Nov 2011 16:58:02 GMT)
Full text and
rfc822 format available.
Message #52 received at 10164-done <at> debbugs.gnu.org (full text, mbox):
> From: Chong Yidong <cyd <at> gnu.org>
> Cc: Juanma Barranquero <lekktu <at> gmail.com>, 10164 <at> debbugs.gnu.org, tim.crews <at> code-affinity.com
> Date: Thu, 01 Dec 2011 00:29:37 +0800
>
> > Chong, please hold off the pretest while I debug this.
>
> I bumped the version number in the trunk before seeing this latest
> message. But, I haven't made the pretest tag yet---will wait.
Thanks. The bug is fixed in revision 106561.
It was simply wrong to try to verify rows' hash values at that spot,
because the code immediately before that reallocates the glyph arrays,
so the contents of a glyph row could be complete garbage. Therefore,
I removed the assertion.
I'm amazed that this assertion didn't trigger until now. I guess too
few people compile with asserts. Or maybe most calls to
adjust_glyph_matrix don't really reallocate, since display margins are
a relatively rarely used feature.
Sorry about this, it was a shameful thinko on my part to introduce
that assertion in the first place.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 17:38:01 GMT)
Full text and
rfc822 format available.
Message #55 received at 10164 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Thanks. The bug is fixed in revision 106561.
>
> It was simply wrong to try to verify rows' hash values at that spot,
> because the code immediately before that reallocates the glyph arrays,
> so the contents of a glyph row could be complete garbage. Therefore,
> I removed the assertion.
>
> I'm amazed that this assertion didn't trigger until now. I guess too
> few people compile with asserts. Or maybe most calls to
> adjust_glyph_matrix don't really reallocate, since display margins are
> a relatively rarely used feature.
>
> Sorry about this, it was a shameful thinko on my part to introduce
> that assertion in the first place.
No worries, and thanks for looking into the problem on such short
notice. I'll make the pretest shortly.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 17:51:01 GMT)
Full text and
rfc822 format available.
Message #58 received at 10164 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 18:08:01 GMT)
Full text and
rfc822 format available.
Message #61 received at 10164 <at> debbugs.gnu.org (full text, mbox):
> Date: Wed, 30 Nov 2011 10:29:39 -0700
> From: Tim Crews <tim.crews <at> code-affinity.com>
>
> > I'm amazed that this assertion didn't trigger until now. I guess too
> > few people compile with asserts. Or maybe most calls to
> > adjust_glyph_matrix don't really reallocate, since display margins are
> > a relatively rarely used feature.
>
> I'm confused about that part. I discovered the bug using the binary
> build that came from http://alpha.gnu.org/gnu/emacs/windows/.
> Isn't this where most people would get their copy of Emacs 24?
I don't know. Quite a few people who track Emacs development build
Emacs themselves. I do, for example.
> Wasn't it compiled with asserts?
Yes, it was. So is my Emacs. I just don't use linum-mode. The
moment I tried it, it crashed for me as well.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 18:11:01 GMT)
Full text and
rfc822 format available.
Message #64 received at 10164 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> I'm amazed that this assertion didn't trigger until now. I guess too
> few people compile with asserts.
You might want to add another option:
configure --enable-checking=xasserts
to enable asserts, it's easier to enable checks when one does not have
to edit files.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 18:31:01 GMT)
Full text and
rfc822 format available.
Message #67 received at 10164 <at> debbugs.gnu.org (full text, mbox):
> From: Dan Nicolaescu <dann <at> gnu.org>
> Cc: eliz <at> gnu.org
> Date: Wed, 30 Nov 2011 13:10:47 -0500
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > I'm amazed that this assertion didn't trigger until now. I guess too
> > few people compile with asserts.
>
> You might want to add another option:
> configure --enable-checking=xasserts
>
> to enable asserts, it's easier to enable checks when one does not have
> to edit files.
I thought that's what "configure --enable-asserts" did. Doesn't it?
Or is that option inconvenient in some way?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#10164
; Package
emacs
.
(Wed, 30 Nov 2011 18:56:02 GMT)
Full text and
rfc822 format available.
Message #70 received at 10164 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Dan Nicolaescu <dann <at> gnu.org>
>> Cc: eliz <at> gnu.org
>> Date: Wed, 30 Nov 2011 13:10:47 -0500
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> > I'm amazed that this assertion didn't trigger until now. I guess too
>> > few people compile with asserts.
>>
>> You might want to add another option:
>> configure --enable-checking=xasserts
>>
>> to enable asserts, it's easier to enable checks when one does not have
>> to edit files.
>
> I thought that's what "configure --enable-asserts" did. Doesn't it?
> Or is that option inconvenient in some way?
I just didn't know about it...
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 29 Dec 2011 12:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 13 years and 113 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.