Subject: Re: bug#29326: 26.0.90; Emacs crash on running comment-dwim

From: Eli Zaretskii <[email-masked]>
Date: Fri, 17 Nov 2017 09:03:52 +0200

> From: Kaushal Modi <[email-masked]>
> Date: Thu, 16 Nov 2017 19:43:00 +0000
> 
> All of a sudden I can get emacs to crash consistently because of some rogue font lock regexp parsing
> between Org mode and nim-mode[1].
> 
> I have attached a test file (that's the smallest I can get to from originally ~1000 line file). I can make the crash
> happen on doing M-x comment-dwim on line 69 (in the test.org file) but not on line 52 and earlier lines for
> example.
> 
> [1]: https://github.com/nim-lang/nim-mode
> 
> It will be tricky to get an emacs -Q recipe with org and nim-mode dependencies. So while I work on getting
> that recipe, does the below backtrace help?

The backtrace says that some Lisp changed the buffer contents in a
way that caused the window-start to become outside the accessible
portion of the buffer.

> Thread 1 "emacs" received signal SIGABRT, Aborted.
> 0x00000033e380f6ab in raise () from /lib64/libpthread.so.0
> (gdb) bt
> #0  0x00000033e380f6ab in raise () from /lib64/libpthread.so.0
> #1  0x000000000058c8f4 in terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:394
> #2  0x00000000006232d5 in die (msg=0x723428 "charpos < 0 || (charpos >= BUF_BEG (current_buffer) &&
> charpos <= ZV)", file=0x72313d "xdisp.c", line=2752) at alloc.c:7419
> #3  0x0000000000449caa in init_iterator (it=0x7fffffff22f0, w=0x888fb60, charpos=9982, bytepos=9982,
> row=0x7d9e430, base_face_id=DEFAULT_FACE_ID) at xdisp.c:2751

In this call frame #3, what is the value of ZV?