Subject: bug#18785: 24.4.1; Emacs hangs with Org mode when point is in LOGBOOK

From: Fabrice Niessen <[email-masked]>
Date: Wed, 22 Oct 2014 12:35:30 +0200

Eli Zaretskii wrote:
> From: Fabrice Niessen <[email-masked]>
>> 
>> On Windows 8, with Emacs 24.4.1 (from Dani) and Org mode version
>> 8.3beta, I can very often freeze Emacs when clocking into a task, or
>> when editing the timestamps found in the LOGBOOK drawer.
>> 
>> I've run Emacs under GDB, and can send a video of it, where you also see
>> that Emacs takes 100% of the CPU. Though, I can only send it on request,
>> as it contains information in my Org buffers which I don't want to see
>> public.
>
> Is that video worth watching?  I mean, what could a video of a frozen
> Emacs tell?

No, I guess it's not.

>> $ gdb ./emacs.exe
>> GNU gdb (GDB) 7.8
>
> This GDB session brings no useful info.  Please follow the method
> described in etc/DEBUG under "If the symptom of the bug is that Emacs
> fails to respond".

I think I can reproduce it "reliably":

1. Open an Org file
2. Go to a task headline
3. Clock into it (C-c C-x C-i)
4. Press down arrown to go to next line
5. Press TAB to open LOGBOOK drawer
6. Press C-c C-n to go the the next task (as drawer is huge)
7. Press up arrow to go to the line before the last clock line
8. Press left arrow to go to the end of the last clock line

I'm not sure whether variations of this do work or not... or whether the
contents of my file does have impact on the recipe.

Now, as asked...

  ┌────
  │ ** If the symptom of the bug is that Emacs fails to respond
  │ 
  │ Don't assume Emacs is `hung'--it may instead be in an infinite loop.
  │ To find out which, make the problem happen under GDB and stop Emacs
  │ once it is not responding.  (If Emacs is using X Windows directly, you
  │ can stop Emacs by typing C-z at the GDB job.)  Then try stepping with
  │ `step'.  If Emacs is hung, the `step' command won't return.  If it is
  │ looping, `step' will return. [...]
  └────

...what I did is launch Emacs from GDB in a Cygwin shell:

--8<---------------cut here---------------start------------->8---
$ gdb ./emacs.exe
GNU gdb (GDB) 7.8
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-cygwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
/cygdrive/d/Users/fni/.gdbinit:19: Error in sourced command file:
No symbol table is loaded.  Use the "file" command.
Reading symbols from ./emacs.exe...done.
(gdb) set debugexceptions 1
(gdb) run
Starting program: /cygdrive/c/Program Files (x86)/emacs-trunk/bin/emacs.exe
[New Thread 4084.0x15cc]
--8<---------------cut here---------------end--------------->8---

I reproduced the problem.

Then, I tried (multiple times) to C-z in the GDB session, but nothing
happens: Emacs stays block and I don't get any GDB prompt.

Am I missing something?

Best regards,
Fabrice