GNU bug report logs - #35429
27.0.50; Arbitrary xdisp.c related crashes when working with overlay-using packages

Previous Next

Package: emacs;

Reported by: Kaushal Modi <kaushal.modi <at> gmail.com>

Date: Thu, 25 Apr 2019 15:38:02 UTC

Severity: normal

Found in version 27.0.50

Done: Kaushal Modi <kaushal.modi <at> gmail.com>

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 35429 in the body.
You can then email your comments to 35429 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Thu, 25 Apr 2019 15:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kaushal Modi <kaushal.modi <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 25 Apr 2019 15:38:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; Arbitrary xdisp.c related crashes when working with
 overlay-using packages
Date: Thu, 25 Apr 2019 11:36:27 -0400
[Message part 1 (text/plain, inline)]
Hello,

In the past one-two weeks, I have been noticing arbitrary crashes when
working in Org mode, with other packages like org-tree-slide and
artist-mode. My guess is that this has to do with packages dealing with
overlays.

I do not have a reproducible recipe, but this time, I got the full
backtrace (attached as gdb.txt).

The log shows the the beacon package caused this. For reference, here is
the source of beacon.el:
http://git.savannah.gnu.org/cgit/emacs/elpa.git/tree/packages/beacon/beacon.el

---


In GNU Emacs 27.0.50 (build 22, x86_64-pc-linux-gnu, GTK+ Version 2.24.23)
 of 2019-04-24 built on
Repository revision: c5358e831f05cdd110f12a4260e6fb607c66c0b4
Repository branch: master
Windowing system distributor 'Open Text', version 11.0.11505
System Description: Red Hat Enterprise Linux Workstation release 6.8
(Santiago)

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
C-c C-c is undefined

Configured using:
 'configure --with-modules
 --prefix=/home/kmodi/usr_local/apps/6/emacs/master
 '--program-transform-name=s/^ctags$/ctags_emacs/'
 --enable-checking=yes,glyphs --enable-check-lisp-object-type
 'CPPFLAGS=-I/home/kmodi/stowed/include
 -I/home/kmodi/usr_local/6/include -I/usr/include/freetype2
 -I/usr/include' 'CFLAGS=-ggdb3 -Og' 'CXXFLAGS=-ggdb3 -Og'
 'LDFLAGS=-L/home/kmodi/stowed/lib -L/home/kmodi/stowed/lib64
 -L/home/kmodi/usr_local/6/lib -L/home/kmodi/usr_local/6/lib64 -ggdb3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB
NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF
XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11 XDBE XIM MODULES THREADS PDUMPER
GMP

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix


--
Kaushal Modi
[Message part 2 (text/html, inline)]
[gdb.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Thu, 25 Apr 2019 20:27:01 GMT) Full text and rfc822 format available.

Message #8 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kaushal Modi <kaushal.modi <at> gmail.com>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50;
 Arbitrary xdisp.c related crashes when working with overlay-using
 packages
Date: Thu, 25 Apr 2019 23:25:39 +0300
> From: Kaushal Modi <kaushal.modi <at> gmail.com>
> Date: Thu, 25 Apr 2019 11:36:27 -0400
> 
> In the past one-two weeks

Any chance for a more accurate time frame?  Or maybe even bisection?

> I have been noticing arbitrary crashes when working in Org mode, with other
> packages like org-tree-slide and artist-mode. My guess is that this has to do with packages dealing with
> overlays.
> 
> I do not have a reproducible recipe, but this time, I got the full backtrace (attached as gdb.txt).

Thanks.  Unfortunately, the backtrace makes no sense to me.  The
buffer was pure ASCII, right?  At least for the first 2K characters it
seems the answer is yes, because:

> #4  0x0000000000584793 in line_number_display_width (w=w <at> entry=0x89da880, width=width <at> entry=0x7fffffff43dc, pixel_width=pixel_width <at> entry=0x7fffffff43e0) at indent.c:1981
>         startpos = {
>           charpos = 2874, 
>           bytepos = 2874
>         }

As you see, the character and the byte positions coincide, which is a
sign of a plain ASCII buffer text.

So it makes little sense that the assertion is violated, because it is
called to validate the same character position of 2874:

> #1  0x00000000005a1232 in die (msg=msg <at> entry=0x680450 "charpos == BYTE_TO_CHAR (bytepos)", file=file <at> entry=0x67dc6a "xdisp.c", line=line <at> entry=3047) at alloc.c:7221
> No locals.
> #2  0x0000000000456b44 in init_iterator (it=it <at> entry=0x7fffffff3040, w=w <at> entry=0x89da880, charpos=2874, bytepos=<optimized out>, row=<optimized out>, base_face_id=base_face_id <at> entry=DEFAULT_FACE_ID) at xdisp.c:3047

So something strange is at work here, and I cannot see what it could
be, especially with all those "optimized out" variables.

I would suggest to try an unoptimized build, and if the same crashes
happen there as well, perhaps the backtrace will tell something more
useful.  It would help to know the value of bytepos argument to
init_iterator, and if it indeed is equal to charpos, the next thing to
look at is the buffer's markers.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Thu, 25 Apr 2019 20:40:02 GMT) Full text and rfc822 format available.

Message #11 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Thu, 25 Apr 2019 16:39:29 -0400
[Message part 1 (text/plain, inline)]
Hello Eli,

On Thu, Apr 25, 2019, 4:26 PM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Kaushal Modi <kaushal.modi <at> gmail.com>
> > Date: Thu, 25 Apr 2019 11:36:27 -0400
> >
> > In the past one-two weeks
>
> Any chance for a more accurate time frame?  Or maybe even bisection?
>

Sorry, I don't have a to consistent way to reproduce this. But I have
noticed that no crash has happened since I disabled the beacon package.

Thanks.  Unfortunately, the backtrace makes no sense to me.  The
> buffer was pure ASCII, right?


If you mean the presence of Unicode characters, then I have the unicode box
drawing characters too. The Org file content is not 100% 8-bit ASCII.

At least for the first 2K characters it
> seems the answer is yes, because:
>
> > #4  0x0000000000584793 in line_number_display_width (w=w <at> entry=0x89da880,
> width=width <at> entry=0x7fffffff43dc, pixel_width=pixel_width <at> entry=0x7fffffff43e0)
> at indent.c:1981
> >         startpos = {
> >           charpos = 2874,
> >           bytepos = 2874
> >         }
>
> As you see, the character and the byte positions coincide, which is a
> sign of a plain ASCII buffer text.
>
> So it makes little sense that the assertion is violated, because it is
> called to validate the same character position of 2874:
>
> > #1  0x00000000005a1232 in die (msg=msg <at> entry=0x680450 "charpos ==
> BYTE_TO_CHAR (bytepos)", file=file <at> entry=0x67dc6a "xdisp.c",
> line=line <at> entry=3047) at alloc.c:7221
> > No locals.
> > #2  0x0000000000456b44 in init_iterator (it=it <at> entry=0x7fffffff3040,
> w=w <at> entry=0x89da880, charpos=2874, bytepos=<optimized out>,
> row=<optimized out>, base_face_id=base_face_id <at> entry=DEFAULT_FACE_ID) at
> xdisp.c:3047
>
> So something strange is at work here, and I cannot see what it could
> be, especially with all those "optimized out" variables.


This time, I enabled logging to a file as there was no way I would be able
to copy all that info screen by screen into the email. Does that option
optimize out certain variables?


> I would suggest to try an unoptimized build,


Hmm, I am already building Emacs with your suggested switches of -ggdb3 and
-Og (from an earlier gdb debug in a different thread). Let me know if a
different set of switches are needed.

and if the same crashes
> happen there as well, perhaps the backtrace will tell something more
> useful.  It would help to know the value of bytepos argument to
> init_iterator, and if it indeed is equal to charpos, the next thing to
> look at is the buffer's markers.
>

I still have the gdb session alive if you want me to run some debug
commands for you.

Thanks.

Kaushal

>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Fri, 26 Apr 2019 07:19:02 GMT) Full text and rfc822 format available.

Message #14 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kaushal Modi <kaushal.modi <at> gmail.com>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Fri, 26 Apr 2019 10:17:59 +0300
> From: Kaushal Modi <kaushal.modi <at> gmail.com>
> Date: Thu, 25 Apr 2019 16:39:29 -0400
> Cc: 35429 <at> debbugs.gnu.org
> 
>  Any chance for a more accurate time frame?  Or maybe even bisection?
> 
> Sorry, I don't have a to consistent way to reproduce this. But I have noticed that no crash has happened since
> I disabled the beacon package. 

I doubt that the beacon package is where the bug is, so I was asking
whether a previous version of master didn't have this problem.  Or are
you saying that you only started using the beacon package a few weeks
ago?

>  Thanks.  Unfortunately, the backtrace makes no sense to me.  The
>  buffer was pure ASCII, right?  
> 
> If you mean the presence of Unicode characters, then I have the unicode box drawing characters too. The Org
> file content is not 100% 8-bit ASCII. 

Not even its first 2874 characters?

Are the box drawing characters part of buffer text, or are they
displayed via overlays and display properties?

> This time, I enabled logging to a file as there was no way I would be able to copy all that info screen by screen
> into the email. Does that option optimize out certain variables?

No.

>  I would suggest to try an unoptimized build, 
> 
> Hmm, I am already building Emacs with your suggested switches of -ggdb3 and -Og (from an earlier gdb
> debug in a different thread). Let me know if a different set of switches are needed.  

By "unoptimized" I mean '-O0 -ggdb3'.  -Og still optimizes, it just
avoids optimizations that make debugging exceptionally hard.

>  and if the same crashes
>  happen there as well, perhaps the backtrace will tell something more
>  useful.  It would help to know the value of bytepos argument to
>  init_iterator, and if it indeed is equal to charpos, the next thing to
>  look at is the buffer's markers.
> 
> I still have the gdb session alive if you want me to run some debug commands for you. 

What are the values of these:

  (gdb) p current_buffer->pt
  (gdb) p current_buffer->pt_byte
  (gdb) p current_buffer->text->gpt
  (gdb) p current_buffer->text->gpt_byte
  (gdb) p current_buffer->begv
  (gdb) p current_buffer->begv_byte
  (gdb) p current_buffer->zv
  (gdb) p current_buffer->zv_byte




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Fri, 26 Apr 2019 14:10:02 GMT) Full text and rfc822 format available.

Message #17 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Fri, 26 Apr 2019 10:08:30 -0400
[Message part 1 (text/plain, inline)]
On Fri, Apr 26, 2019 at 3:18 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

>
> I doubt that the beacon package is where the bug is, so I was asking
> whether a previous version of master didn't have this problem.  Or are
> you saying that you only started using the beacon package a few weeks
> ago?
>

No, I have been using beacon package for few years now.


> > If you mean the presence of Unicode characters, then I have the unicode
> box drawing characters too. The Org
> > file content is not 100% 8-bit ASCII.
>
> Not even its first 2874 characters?
>

Those characters are in the buffer, not overlay. And they are not in the
first 2874 characters.
Here are the roughly first 3000 chars of that Org buffer: http://ix.io/1Hgv

Note that at many places in that snippet, I have "=>" characters which I
replace with a unicode symbol via prettify-symbols mode. E.g. "=>" is
replaced with:

             position: 5434 of 8347 (65%), column: 35
            character:  (displayed as ) (codepoint 59428, #o164044,
#xe824)
              charset: unicode (Unicode (ISO10646))
code point in charset: 0xE824
               syntax: w     which means: word
             category: L:Left-to-right (strong)
             to input: type "C-x 8 RET e824"
          buffer code: #xEE #xA0 #xA4
            file code: #xEE #xA0 #xA4 (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    xft:-unknown-PragmataPro-normal-normal-normal-*-17-*-*-*-*-0-iso10646-1
(#x11D5)

Character code properties: customize what to show
  general-category: Co (Other, Private Use)
  decomposition: (59428) ('')

There are text properties here:
  fontified            nil

Would that be causing a problem?

Here is my entire set of ligature substitution using prettify-symbols:
http://ix.io/1Hgw/elisp



> By "unoptimized" I mean '-O0 -ggdb3'.  -Og still optimizes, it just
> avoids optimizations that make debugging exceptionally hard.
>

Understood. Thank you, will build with -O0 -ggdb3 going forward.


> What are the values of these:
>
>   (gdb) p current_buffer->pt
>   (gdb) p current_buffer->pt_byte
>   (gdb) p current_buffer->text->gpt
>   (gdb) p current_buffer->text->gpt_byte
>   (gdb) p current_buffer->begv
>   (gdb) p current_buffer->begv_byte
>   (gdb) p current_buffer->zv
>   (gdb) p current_buffer->zv_byte
>

(gdb) p current_buffer->pt
$1 = 1406
(gdb) p current_buffer->pt_byte
$2 = 1418
(gdb) p current_buffer->text->gpt
$3 = 1
(gdb) p current_buffer->text->gpt_byte
$4 = 1
(gdb) p current_buffer->begv
$5 = 1
(gdb) p current_buffer->begv_byte
$6 = 1
(gdb) p current_buffer->zv
$7 = 20122
(gdb) p current_buffer->zv_byte
$8 = 20804
(gdb)

 Thank you.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Fri, 26 Apr 2019 18:10:01 GMT) Full text and rfc822 format available.

Message #20 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kaushal Modi <kaushal.modi <at> gmail.com>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Fri, 26 Apr 2019 21:08:40 +0300
> From: Kaushal Modi <kaushal.modi <at> gmail.com>
> Date: Fri, 26 Apr 2019 10:08:30 -0400
> Cc: 35429 <at> debbugs.gnu.org
> 
>  > If you mean the presence of Unicode characters, then I have the unicode box drawing characters too.
>  The Org
>  > file content is not 100% 8-bit ASCII. 
> 
>  Not even its first 2874 characters?
> 
> Those characters are in the buffer, not overlay. And they are not in the first 2874 characters.
> Here are the roughly first 3000 chars of that Org buffer: http://ix.io/1Hgv

That's strange, because the data you printed in GDB says there's at
least one non-ASCII character within the first 1406 character
positions.

> Note that at many places in that snippet, I have "=>" characters which I replace with a unicode symbol via
> prettify-symbols mode. E.g. "=>" is replaced with:
> 
>              position: 5434 of 8347 (65%), column: 35
>             character:  (displayed as ) (codepoint 59428, #o164044, #xe824)
>               charset: unicode (Unicode (ISO10646))
> code point in charset: 0xE824
>                syntax: w     which means: word
>              category: L:Left-to-right (strong)
>              to input: type "C-x 8 RET e824"
>           buffer code: #xEE #xA0 #xA4
>             file code: #xEE #xA0 #xA4 (encoded by coding system utf-8-unix)
>               display: by this font (glyph code)
>     xft:-unknown-PragmataPro-normal-normal-normal-*-17-*-*-*-*-0-iso10646-1 (#x11D5)
> 
> Character code properties: customize what to show
>   general-category: Co (Other, Private Use)
>   decomposition: (59428) ('')

Why are you using PU characters?  They will only work with specific
fonts, not in general.  I advise against that.  But I don't think this
is the reason, as no valid Unicode point should ever cause a crash.

> (gdb) p current_buffer->pt
> $1 = 1406
> (gdb) p current_buffer->pt_byte
> $2 = 1418

This is inconsistent both with the image of the buffer you posted
above and with the fact that character position 2874 corresponds to a
byte position 2874.

Are you sure the current buffer is your Org buffer?  What do the
following commands display?

 (gdb) p current_buffer->name_
 (gdb) xstring
 (gdb) fr 2
 (gdb) p w->contents
 (gdb) xtype
 (gdb) xbuffer




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Fri, 26 Apr 2019 18:24:01 GMT) Full text and rfc822 format available.

Message #23 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Fri, 26 Apr 2019 14:22:51 -0400
[Message part 1 (text/plain, inline)]
On Fri, Apr 26, 2019 at 2:09 PM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > Those characters are in the buffer, not overlay. And they are not in the
> first 2874 characters.
> > Here are the roughly first 3000 chars of that Org buffer:
> http://ix.io/1Hgv
>
> That's strange, because the data you printed in GDB says there's at
> least one non-ASCII character within the first 1406 character
> positions.
>

The results of the gdb commands explains this confusion :)

> Character code properties: customize what to show
> >   general-category: Co (Other, Private Use)
> >   decomposition: (59428) ('')
>
> Why are you using PU characters?  They will only work with specific
> fonts, not in general.  I advise against that.  But I don't think this
> is the reason, as no valid Unicode point should ever cause a crash.
>
> > (gdb) p current_buffer->pt
> > $1 = 1406
> > (gdb) p current_buffer->pt_byte
> > $2 = 1418
>
> This is inconsistent both with the image of the buffer you posted
> above and with the fact that character position 2874 corresponds to a
> byte position 2874.
>

Yes, this mapping is only for PragmataPro font. It's just because I did not
know of any other way to map to the ligature codes provided by the font.

Are you sure the current buffer is your Org buffer?


I was .. until now .. I most likely had the frame split in two windows with
one showing that Org file and the other showing ascii-art-to-unicode.el.
Here is that file:
http://git.savannah.gnu.org/cgit/emacs/elpa.git/tree/packages/ascii-art-to-unicode/ascii-art-to-unicode.el

And that file definitely has a lot of unicode characters in the first 2k
lines.

(That ties back to the box characters which I was trying to add to the Org
file.)


>   What do the
> following commands display?
>
>  (gdb) p current_buffer->name_
>  (gdb) xstring
>  (gdb) fr 2
>  (gdb) p w->contents
>  (gdb) xtype
>  (gdb) xbuffer
>

(gdb) p current_buffer->name_
$9 = XIL(0xc35be44)
(gdb) xstring
$10 = (struct Lisp_String *) 0xc35be40
"ascii-art-to-unicode.el"
(gdb) fr 2
#2  0x0000000000456b44 in init_iterator (it=it <at> entry=0x7fffffff3040,
w=w <at> entry=0x89da880, charpos=2874,
    bytepos=<optimized out>, row=<optimized out>,
base_face_id=base_face_id <at> entry=DEFAULT_FACE_ID)
    at xdisp.c:3047
3047          eassert (charpos == BYTE_TO_CHAR (bytepos));
(gdb) p w->contents
$11 = XIL(0xc35be95)
(gdb) xtype
Lisp_Vectorlike
PVEC_BUFFER
(gdb) xbuffer
$12 = (struct buffer *) 0xc35be90
(unsigned char *) 0xb6e97a0 "ascii-art-to-unicode.el"
(gdb)

I hope this helps.

This debug is turning out to be interesting with each update :)

Thanks.

Kaushal
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Fri, 26 Apr 2019 18:33:02 GMT) Full text and rfc822 format available.

Message #26 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kaushal Modi <kaushal.modi <at> gmail.com>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Fri, 26 Apr 2019 21:32:26 +0300
> From: Kaushal Modi <kaushal.modi <at> gmail.com>
> Date: Fri, 26 Apr 2019 14:22:51 -0400
> Cc: 35429 <at> debbugs.gnu.org
> 
> (gdb) p current_buffer->name_
> $9 = XIL(0xc35be44)
> (gdb) xstring
> $10 = (struct Lisp_String *) 0xc35be40
> "ascii-art-to-unicode.el"
> (gdb) fr 2
> #2  0x0000000000456b44 in init_iterator (it=it <at> entry=0x7fffffff3040, w=w <at> entry=0x89da880, charpos=2874,
>     bytepos=<optimized out>, row=<optimized out>,
> base_face_id=base_face_id <at> entry=DEFAULT_FACE_ID)
>     at xdisp.c:3047
> 3047          eassert (charpos == BYTE_TO_CHAR (bytepos));
> (gdb) p w->contents
> $11 = XIL(0xc35be95)
> (gdb) xtype
> Lisp_Vectorlike
> PVEC_BUFFER
> (gdb) xbuffer
> $12 = (struct buffer *) 0xc35be90
> (unsigned char *) 0xb6e97a0 "ascii-art-to-unicode.el"
> (gdb) 
> 
> I hope this helps.

It does.

So now what do the following commands tell?

  (gdb) fr 2
  (gdb) p w->start
  (gdb) xmarker
  (gdb) p *$




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Fri, 26 Apr 2019 18:36:02 GMT) Full text and rfc822 format available.

Message #29 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Fri, 26 Apr 2019 14:34:38 -0400
[Message part 1 (text/plain, inline)]
On Fri, Apr 26, 2019 at 2:32 PM Eli Zaretskii <eliz <at> gnu.org> wrote:

> So now what do the following commands tell?
>
>   (gdb) fr 2
>   (gdb) p w->start
>   (gdb) xmarker
>   (gdb) p *$
>

(gdb) fr 2
#2  0x0000000000456b44 in init_iterator (it=it <at> entry=0x7fffffff3040,
w=w <at> entry=0x89da880, charpos=2874,
    bytepos=<optimized out>, row=<optimized out>,
base_face_id=base_face_id <at> entry=DEFAULT_FACE_ID)
    at xdisp.c:3047
3047          eassert (charpos == BYTE_TO_CHAR (bytepos));
(gdb) p w->start
$13 = XIL(0x89daa95)
(gdb) xmarker
$14 = (struct Lisp_Marker *) 0x89daa90
(gdb) p *$
$15 = {
  header = {
    size = 4611686018477740032
  },
  buffer = 0x8d95c10,
  need_adjustment = false,
  insertion_type = false,
  next = 0x89daaf0,
  charpos = 2874,
  bytepos = 2874
}
(gdb)
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Fri, 26 Apr 2019 19:06:02 GMT) Full text and rfc822 format available.

Message #32 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kaushal Modi <kaushal.modi <at> gmail.com>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Fri, 26 Apr 2019 22:04:54 +0300
> From: Kaushal Modi <kaushal.modi <at> gmail.com>
> Date: Fri, 26 Apr 2019 14:34:38 -0400
> Cc: 35429 <at> debbugs.gnu.org
> 
> (gdb) fr 2
> #2  0x0000000000456b44 in init_iterator (it=it <at> entry=0x7fffffff3040, w=w <at> entry=0x89da880, charpos=2874,
>     bytepos=<optimized out>, row=<optimized out>,
> base_face_id=base_face_id <at> entry=DEFAULT_FACE_ID)
>     at xdisp.c:3047
> 3047          eassert (charpos == BYTE_TO_CHAR (bytepos));
> (gdb) p w->start
> $13 = XIL(0x89daa95)
> (gdb) xmarker
> $14 = (struct Lisp_Marker *) 0x89daa90
> (gdb) p *$
> $15 = {
>   header = {
>     size = 4611686018477740032
>   },
>   buffer = 0x8d95c10,
>   need_adjustment = false,
>   insertion_type = false,
>   next = 0x89daaf0,
>   charpos = 2874,
>   bytepos = 2874
> }
> (gdb) 

So the window's start point is outdated.  How did that happen?  What
kind of stuff do you have on window-scroll-functions?  This should
show us:

  (gdb) pp Vwindow_scroll_functions

Also, what buffer does the window-start marker record?

  (gdb) fr 2
  (gdb) p w->start
  (gdb) xmarker
  (gdb) p $->buffer->name_
  (gdb) xstring




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Fri, 26 Apr 2019 19:14:01 GMT) Full text and rfc822 format available.

Message #35 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Fri, 26 Apr 2019 15:12:31 -0400
[Message part 1 (text/plain, inline)]
On Fri, Apr 26, 2019 at 3:05 PM Eli Zaretskii <eliz <at> gnu.org> wrote:

>
> So the window's start point is outdated.  How did that happen?  What
> kind of stuff do you have on window-scroll-functions?  This should
> show us:
>
>   (gdb) pp Vwindow_scroll_functions
>

Seems like that caused gdb to crash again?

(gdb) pp Vwindow_scroll_functions

xdisp.c:3047: Emacs fatal error: assertion failed: charpos == BYTE_TO_CHAR
(bytepos)

Thread 1 "emacs" hit Breakpoint 1, terminate_due_to_signal (sig=sig <at> entry=6,
    backtrace_limit=backtrace_limit <at> entry=2147483647) at emacs.c:375
375     {
The program being debugged stopped while in a function called from GDB.
Evaluation of the expression containing the function
(safe_debug_print) will be abandoned.
When the function is done executing, GDB will silently stop.
(gdb)

But from an uncrashed emacs, with beacon loaded as before, C-h v
window-scroll-functions gives ...

(beacon--window-scroll-function)

beacon--window-scroll-function:
http://git.savannah.gnu.org/cgit/emacs/elpa.git/tree/packages/beacon/beacon.el#n425



> Also, what buffer does the window-start marker record?
>
>   (gdb) fr 2
>   (gdb) p w->start
>   (gdb) xmarker
>   (gdb) p $->buffer->name_
>   (gdb) xstring
>

(gdb) pp Vwindow_scroll_functions

xdisp.c:3047: Emacs fatal error: assertion failed: charpos == BYTE_TO_CHAR
(bytepos)

Thread 1 "emacs" hit Breakpoint 1, terminate_due_to_signal (sig=sig <at> entry=6,
    backtrace_limit=backtrace_limit <at> entry=2147483647) at emacs.c:375
375     {
The program being debugged stopped while in a function called from GDB.
Evaluation of the expression containing the function
(safe_debug_print) will be abandoned.
When the function is done executing, GDB will silently stop.
(gdb) fr 2
#2  0x0000000000456b44 in init_iterator (it=it <at> entry=0x7ffffffef990,
w=w <at> entry=0x89da880, charpos=2874,
    bytepos=<optimized out>, row=<optimized out>,
base_face_id=base_face_id <at> entry=DEFAULT_FACE_ID)
    at xdisp.c:3047
3047          eassert (charpos == BYTE_TO_CHAR (bytepos));
(gdb) p w->start
$16 = XIL(0x89daa95)
(gdb) xmarker
$17 = (struct Lisp_Marker *) 0x89daa90
(gdb) p $->buffer->name_
$18 = XIL(0x7960234)
(gdb) xstring
$19 = (struct Lisp_String *) 0x7960230
"standard-reading.org"
(gdb)

That "standard-reading.org" is the Org file whose ~3000 character snippet
that I linked earlier.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Fri, 26 Apr 2019 19:27:02 GMT) Full text and rfc822 format available.

Message #38 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kaushal Modi <kaushal.modi <at> gmail.com>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Fri, 26 Apr 2019 22:25:52 +0300
> From: Kaushal Modi <kaushal.modi <at> gmail.com>
> Date: Fri, 26 Apr 2019 15:12:31 -0400
> Cc: 35429 <at> debbugs.gnu.org
> 
> (gdb) p w->start
> $16 = XIL(0x89daa95)
> (gdb) xmarker
> $17 = (struct Lisp_Marker *) 0x89daa90
> (gdb) p $->buffer->name_
> $18 = XIL(0x7960234)
> (gdb) xstring
> $19 = (struct Lisp_String *) 0x7960230
> "standard-reading.org"
> (gdb)
> 
> That "standard-reading.org" is the Org file whose ~3000 character snippet that I linked earlier.

So the window-start marker belongs to the wrong buffer.

Was standard-reading.org the buffer displayed in the selected window?
Did you switch buffers right before the crash?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Fri, 26 Apr 2019 19:41:02 GMT) Full text and rfc822 format available.

Message #41 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Fri, 26 Apr 2019 15:39:56 -0400
[Message part 1 (text/plain, inline)]
On Fri, Apr 26, 2019 at 3:26 PM Eli Zaretskii <eliz <at> gnu.org> wrote:

>
> So the window-start marker belongs to the wrong buffer.
>
> Was standard-reading.org the buffer displayed in the selected window?
> Did you switch buffers right before the crash?
>

I am a bit hazy in my memory regarding that .. it's very likely I did that.
All I can tell is that I was quickly scrolling/switching windows when this
crash happened.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Fri, 26 Apr 2019 19:44:01 GMT) Full text and rfc822 format available.

Message #44 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kaushal Modi <kaushal.modi <at> gmail.com>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Fri, 26 Apr 2019 22:43:05 +0300
> From: Kaushal Modi <kaushal.modi <at> gmail.com>
> Date: Fri, 26 Apr 2019 15:39:56 -0400
> Cc: 35429 <at> debbugs.gnu.org
> 
>  Was standard-reading.org the buffer displayed in the selected window?
>  Did you switch buffers right before the crash?
> 
> I am a bit hazy in my memory regarding that .. it's very likely I did that. All I can tell is that I was quickly
> scrolling/switching windows when this crash happened. 

OK, I installed a stab-in-the-dark kind of defense against such
calamities, hopefully the assertion violations will now go away.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Fri, 26 Apr 2019 19:45:02 GMT) Full text and rfc822 format available.

Message #47 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Fri, 26 Apr 2019 15:43:22 -0400
[Message part 1 (text/plain, inline)]
On Fri, Apr 26, 2019 at 3:39 PM Kaushal Modi <kaushal.modi <at> gmail.com> wrote:

> On Fri, Apr 26, 2019 at 3:26 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
>>
>> So the window-start marker belongs to the wrong buffer.
>>
>> Was standard-reading.org the buffer displayed in the selected window?
>> Did you switch buffers right before the crash?
>>
>
> I am a bit hazy in my memory regarding that .. it's very likely I did
> that. All I can tell is that I was quickly scrolling/switching windows when
> this crash happened.
>

Now in another emacs instance, with beacon enabled, I am frantically
switching and scrolling side by side windows: one having
ascii-art-to-unicode.el and another with that same Org file, and this time,
the crash is not happening :(
[Message part 2 (text/html, inline)]

Reply sent to Kaushal Modi <kaushal.modi <at> gmail.com>:
You have taken responsibility. (Wed, 01 May 2019 15:47:02 GMT) Full text and rfc822 format available.

Notification sent to Kaushal Modi <kaushal.modi <at> gmail.com>:
bug acknowledged by developer. (Wed, 01 May 2019 15:47:02 GMT) Full text and rfc822 format available.

Message #52 received at 35429-done <at> debbugs.gnu.org (full text, mbox):

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, 35429-done <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Wed, 1 May 2019 11:45:47 -0400
[Message part 1 (text/plain, inline)]
On Fri, Apr 26, 2019 at 3:43 PM Eli Zaretskii <eliz <at> gnu.org> wrote:

>
> OK, I installed a stab-in-the-dark kind of defense against such
> calamities, hopefully the assertion violations will now go away.
>

Hello Eli,

Looks like this "stab-in-the-dark" fix was pretty good; haven't noticed any
crash in the last 3 days.

So I am closing this issue. If I see a crash, I'll open a new issue for
that.

Thanks!
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#35429; Package emacs. (Wed, 01 May 2019 17:20:01 GMT) Full text and rfc822 format available.

Message #55 received at 35429 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kaushal Modi <kaushal.modi <at> gmail.com>
Cc: 35429 <at> debbugs.gnu.org
Subject: Re: bug#35429: 27.0.50; Arbitrary xdisp.c related crashes when
 working with overlay-using packages
Date: Wed, 01 May 2019 20:19:39 +0300
> From: Kaushal Modi <kaushal.modi <at> gmail.com>
> Date: Wed, 1 May 2019 11:45:47 -0400
> 
>  OK, I installed a stab-in-the-dark kind of defense against such
>  calamities, hopefully the assertion violations will now go away.
> 
> Hello Eli,
> 
> Looks like this "stab-in-the-dark" fix was pretty good; haven't noticed any crash in the last 3 days.
> 
> So I am closing this issue. If I see a crash, I'll open a new issue for that.

OK, thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 30 May 2019 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 329 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.