Subject: bug#16326: 24.3.50; Emacs crashes when C-c C-c to end the capture of an Org note

From: "Sebastien Vauban" <[email-masked]>
Date: Thu, 02 Jan 2014 13:44:35 +0100

Hello,

First, let me thank an happy new year for you all, the Emacs developers!

Second, I just downloaded this morning a new version of Emacs (Windows
binary), compiled by Dani on the 29th of December.

It is quite unstable for me: it crashed no less than 4 times over
a couple of hours...

    Note -- Up to now, I was using r114715 (from 2013-10-19). That one
    was quite stable: almost no crash at all. I tried updating this
    morning to see if the Org display performance problem (because of
    the display of UTF-8 characters) was solved with new versions. That
    is well solved (thanks to a workaround, IIUC).

I had no time to try debugging the first crashes. Now, I can afford
looking at it.

Here is the backtrace:

--8<---------------cut here---------------start------------->8---
$ gdb -p 1020
GNU gdb (GDB) 7.6.50.20130728-cvs (cygwin-special)
Copyright (C) 2013 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/sva/.gdbinit:21: Error in sourced command file:
No symbol table is loaded.  Use the "file" command.
Attaching to process 1020
[New Thread 1020.0x1afc]
[New Thread 1020.0xbb4]
[New Thread 1020.0x1d38]
[New Thread 1020.0x19f4]
[New Thread 1020.0x49c]
Reading symbols from /cygdrive/c/Program Files (x86)/emacs-trunk/bin/emacs.exe...done.
(gdb) continue
Continuing.
[Thread 1020.0x49c exited with code 0]

Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 1020.0x1afc]
0x75259bfd in KERNELBASE!DebugBreak ()
   from /cygdrive/c/Windows/SYSTEM32/KERNELBASE.dll
(gdb) thread apply all backtrace

Thread 4 (Thread 1020.0x19f4):
#0  0x774be1a4 in ntdll!ZwWaitForMultipleObjects ()
   from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#1  0x751dc752 in KERNELBASE!GetModuleHandleExW ()
   from /cygdrive/c/Windows/SYSTEM32/KERNELBASE.dll
#2  0x74f76ab5 in WaitForMultipleObjects ()
   from /cygdrive/c/Windows/SYSTEM32/KERNEL32.DLL
#3  0x717e1d8c in msiltcfg!RestartMsi ()
   from /cygdrive/c/Windows/SYSTEM32/msiltcfg.dll
#4  0x74f7850d in KERNEL32!BaseThreadInitThunk ()
   from /cygdrive/c/Windows/SYSTEM32/KERNEL32.DLL
#5  0x774ebf39 in ntdll!RtlInitializeExceptionChain ()
   from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#6  0x774ebf0c in ntdll!RtlInitializeExceptionChain ()
   from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#7  0x00000000 in ?? ()

Thread 3 (Thread 1020.0x1d38):
#0  0x774bf6b4 in ntdll!ZwWaitForWorkViaWorkerFactory ()
   from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#1  0x774b4524 in ntdll!TpIsTimerSet ()
   from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#2  0x74f7850d in KERNEL32!BaseThreadInitThunk ()
   from /cygdrive/c/Windows/SYSTEM32/KERNEL32.DLL
#3  0x774ebf39 in ntdll!RtlInitializeExceptionChain ()
   from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#4  0x774ebf0c in ntdll!RtlInitializeExceptionChain ()
   from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#5  0x00000000 in ?? ()

Thread 2 (Thread 1020.0xbb4):
#0  0x750bb891 in USER32!CharNextA ()
   from /cygdrive/c/Windows/SYSTEM32/USER32.dll
#1  0x011ef727 in w32_msg_pump (msg_buf=0x6c66ff24)
    at c:/msys/home/Dani/emacs/trunk/src/w32fns.c:2459
#2  0x011ef965 in w32_msg_worker@4 (arg=0x0)
    at c:/msys/home/Dani/emacs/trunk/src/w32fns.c:2685
#3  0x74f7850d in KERNEL32!BaseThreadInitThunk ()
   from /cygdrive/c/Windows/SYSTEM32/KERNEL32.DLL
#4  0x774ebf39 in ntdll!RtlInitializeExceptionChain ()
   from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#5  0x774ebf0c in ntdll!RtlInitializeExceptionChain ()
   from /cygdrive/c/Windows/SYSTEM32/ntdll.dll
#6  0x00000000 in ?? ()

Thread 1 (Thread 1020.0x1afc):
#0  0x75259bfd in KERNELBASE!DebugBreak ()
   from /cygdrive/c/Windows/SYSTEM32/KERNELBASE.dll
#1  0x011fb226 in emacs_abort ()
    at c:/msys/home/Dani/emacs/trunk/src/w32fns.c:8419
#2  0x010efc16 in terminate_due_to_signal (sig=22, backtrace_limit=2147483647)
    at c:/msys/home/Dani/emacs/trunk/src/emacs.c:378
#3  0x0116191d in die (
    msg=0x14aba14 <DEFAULT_REHASH_SIZE+412> "c->buffer_beg <= start && end <= c->buffer_end",
    file=0x14ab880 <DEFAULT_REHASH_SIZE+8> "c:/msys/home/Dani/emacs/trunk/src/region-cache.c", line=364) at c:/msys/home/Dani/emacs/trunk/src/alloc.c:6760
#4  0x011d487e in set_cache_region (c=0x6683e40, start=90352, end=90352,
    value=1) at c:/msys/home/Dani/emacs/trunk/src/region-cache.c:364
#5  0x011d4f8a in know_region_cache (buf=0x380d600, c=0x6683e40, start=90352,
    end=90352) at c:/msys/home/Dani/emacs/trunk/src/region-cache.c:671
#6  0x011448c5 in find_newline (start=90352, start_byte=91158, end=1,
    end_byte=1, count=-1, shortage=0x88bebc, bytepos=0x88bec0, allow_quit=true)
    at c:/msys/home/Dani/emacs/trunk/src/search.c:817
#7  0x0113b873 in Fforward_line (n=0)
    at c:/msys/home/Dani/emacs/trunk/src/cmds.c:135
#8  0x0116d9cf in Fline_beginning_position (n=4)
    at c:/msys/home/Dani/emacs/trunk/src/editfns.c:772
#9  0x0113b9fb in Fbeginning_of_line (n=4)
    at c:/msys/home/Dani/emacs/trunk/src/cmds.c:172
#10 0x0117fb83 in Ffuncall (nargs=1, args=0x88c014)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2805
#11 0x011c062c in exec_byte_code (bytestr=99699537, vector=87591325,
    maxdepth=20, args_template=58390562, nargs=0, args=0x0)
    at c:/msys/home/Dani/emacs/trunk/src/bytecode.c:919
#12 0x01180729 in funcall_lambda (fun=98981141, nargs=1, arg_vector=0x538899d)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:3039
#13 0x01180084 in apply_lambda (fun=98981141, args=98167718)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2914
#14 0x0117ea62 in eval_sub (form=98167726)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2220
#15 0x0117c95e in internal_lisp_condition_case (var=58390562,
    bodyform=98167726, handlers=98167606)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:1313
#16 0x0117c446 in Fcondition_case (args=98167734)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:1241
#17 0x0117e559 in eval_sub (form=98167742)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2123
#18 0x0117a37c in Fprogn (body=98167502)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:458
#19 0x01180694 in funcall_lambda (fun=98167446, nargs=1, arg_vector=0x88c650)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:3032
#20 0x01180084 in apply_lambda (fun=98167446, args=95889430)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2914
#21 0x0117ebd5 in eval_sub (form=95889438)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2250
#22 0x0117c95e in internal_lisp_condition_case (var=58390562,
    bodyform=95889438, handlers=95889190)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:1313
#23 0x0117c446 in Fcondition_case (args=95889446)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:1241
#24 0x0117e559 in eval_sub (form=95889534)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2123
#25 0x0117e751 in eval_sub (form=95889542)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2160
#26 0x0117a0ac in Fif (args=95889118)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:405
#27 0x0117e559 in eval_sub (form=95889550)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2123
#28 0x0117a37c in Fprogn (body=95888998)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:458
#29 0x0116de55 in Fsave_excursion (args=95888998)
    at c:/msys/home/Dani/emacs/trunk/src/editfns.c:941
#30 0x0117e559 in eval_sub (form=95889558)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2123
#31 0x0117a37c in Fprogn (body=95888894)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:458
#32 0x01180694 in funcall_lambda (fun=95888838, nargs=0, arg_vector=0x88cd20)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:3032
#33 0x01180084 in apply_lambda (fun=95888838, args=58390562)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2914
#34 0x0117ebd5 in eval_sub (form=99103414)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2250
#35 0x01180024 in apply_lambda (fun=92942078, args=99103422)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2905
#36 0x0117ebd5 in eval_sub (form=99103406)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2250
#37 0x0117a5d8 in Fsetq (args=99103398)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:535
#38 0x0117e559 in eval_sub (form=99103390)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2123
#39 0x0117a37c in Fprogn (body=99167566)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:458
#40 0x0117c016 in internal_catch (tag=99137538, func=0x117a325 <Fprogn>,
    arg=99167550) at c:/msys/home/Dani/emacs/trunk/src/eval.c:1108
#41 0x0117bf37 in Fcatch (args=99167542)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:1083
#42 0x0117e559 in eval_sub (form=99167534)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2123
#43 0x0117a37c in Fprogn (body=99165782)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:458
#44 0x0117bc12 in Fwhile (args=99165766)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:988
#45 0x0117e559 in eval_sub (form=99165758)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2123
#46 0x0117a37c in Fprogn (body=99165870)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:458
#47 0x0116de55 in Fsave_excursion (args=99099358)
    at c:/msys/home/Dani/emacs/trunk/src/editfns.c:941
#48 0x0117e559 in eval_sub (form=99099350)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2123
#49 0x0117a37c in Fprogn (body=99165878)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:458
#50 0x0117b689 in FletX (args=99166038)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:896
#51 0x0117e559 in eval_sub (form=99166046)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2123
#52 0x0117a37c in Fprogn (body=99166086)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:458
#53 0x01180694 in funcall_lambda (fun=99166054, nargs=3, arg_vector=0x88d710)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:3032
#54 0x01180084 in apply_lambda (fun=99166054, args=102459486)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2914
#55 0x0117ebd5 in eval_sub (form=102459462)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2250
#56 0x0117a37c in Fprogn (body=102459542)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:458
#57 0x0117bb14 in Flet (args=102459454)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:966
#58 0x0117e559 in eval_sub (form=102459438)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2123
#59 0x0117a37c in Fprogn (body=102459646)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:458
#60 0x01180694 in funcall_lambda (fun=102459710, nargs=0, arg_vector=0x88dbdc)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:3032
#61 0x0117fe92 in Ffuncall (nargs=1, args=0x88dbd8)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2866
#62 0x0117f127 in funcall_nil (nargs=1, args=0x88dbd8)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2356
#63 0x0117f52e in run_hook_with_args (nargs=1, args=0x88dbd8,
    funcall=0x117f10f <funcall_nil>)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2541
#64 0x0117f16b in Frun_hooks (nargs=1, args=0x88dc98)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2383
#65 0x0117fa73 in Ffuncall (nargs=2, args=0x88dc94)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2786
#66 0x011c062c in exec_byte_code (bytestr=19420353, vector=19568373,
    maxdepth=8, args_template=0, nargs=0, args=0x88dfc4)
    at c:/msys/home/Dani/emacs/trunk/src/bytecode.c:919
#67 0x01180365 in funcall_lambda (fun=19568349, nargs=0, arg_vector=0x88dfc4)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2973
#68 0x0117fdbf in Ffuncall (nargs=1, args=0x88dfc0)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2854
#69 0x0117e6eb in eval_sub (form=95095878)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2147
#70 0x0117c95e in internal_lisp_condition_case (var=60136066,
    bodyform=95095878, handlers=95095830)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:1313
#71 0x011c156c in exec_byte_code (bytestr=19567993, vector=19568013,
    maxdepth=40, args_template=0, nargs=0, args=0x88e490)
    at c:/msys/home/Dani/emacs/trunk/src/bytecode.c:1169
#72 0x01180365 in funcall_lambda (fun=19567965, nargs=0, arg_vector=0x88e490)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2973
#73 0x0117fdbf in Ffuncall (nargs=1, args=0x88e48c)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2854
#74 0x011c062c in exec_byte_code (bytestr=19567329, vector=19567349,
    maxdepth=20, args_template=1024, nargs=0, args=0x88e720)
    at c:/msys/home/Dani/emacs/trunk/src/bytecode.c:919
#75 0x01180365 in funcall_lambda (fun=19567301, nargs=0, arg_vector=0x88e720)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2973
#76 0x01180084 in apply_lambda (fun=19567301, args=58390562)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2914
#77 0x0117ea62 in eval_sub (form=101481846)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2220
#78 0x0117a37c in Fprogn (body=101473086)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:458
#79 0x0117bb14 in Flet (args=101472470)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:966
#80 0x0117e559 in eval_sub (form=101472462)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2123
#81 0x0117a37c in Fprogn (body=101472454)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:458
#82 0x01180694 in funcall_lambda (fun=101478654, nargs=1, arg_vector=0x88eb58)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:3032
#83 0x0117fe92 in Ffuncall (nargs=2, args=0x88eb54)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2866
#84 0x011c062c in exec_byte_code (bytestr=153677777, vector=126924389,
    maxdepth=12, args_template=58390562, nargs=0, args=0x0)
    at c:/msys/home/Dani/emacs/trunk/src/bytecode.c:919
#85 0x01180729 in funcall_lambda (fun=126924429, nargs=2, arg_vector=0x790b665)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:3039
#86 0x0117fdbf in Ffuncall (nargs=3, args=0x88ef6c)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2854
#87 0x0117ed13 in Fapply (nargs=3, args=0x88ef6c)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2291
#88 0x0117fa73 in Ffuncall (nargs=4, args=0x88ef68)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2786
#89 0x011c062c in exec_byte_code (bytestr=61124321, vector=126953261,
    maxdepth=20, args_template=512, nargs=1, args=0x88f2e4)
    at c:/msys/home/Dani/emacs/trunk/src/bytecode.c:919
#90 0x01180365 in funcall_lambda (fun=126953285, nargs=1, arg_vector=0x88f2e4)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2973
#91 0x0117fdbf in Ffuncall (nargs=2, args=0x88f2e0)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2854
#92 0x011792ff in Fcall_interactively (function=90400194,
    record_flag=58390562, keys=58411893)
    at c:/msys/home/Dani/emacs/trunk/src/callint.c:836
#93 0x0117fbd8 in Ffuncall (nargs=4, args=0x88f50c)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2812
#94 0x011c062c in exec_byte_code (bytestr=19807289, vector=19807309,
    maxdepth=52, args_template=4100, nargs=1, args=0x88f850)
    at c:/msys/home/Dani/emacs/trunk/src/bytecode.c:919
#95 0x01180365 in funcall_lambda (fun=19807269, nargs=1, arg_vector=0x88f84c)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2973
#96 0x0117fdbf in Ffuncall (nargs=2, args=0x88f848)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2854
#97 0x0117f66e in call1 (fn=58436706, arg1=90400194)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:2604
#98 0x010f3fc5 in command_loop_1 ()
    at c:/msys/home/Dani/emacs/trunk/src/keyboard.c:1552
#99 0x0117ca69 in internal_condition_case (bfun=0x10f3961 <command_loop_1>,
    handlers=58442018, hfun=0x10f31c7 <cmd_error>)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:1344
#100 0x010f3616 in command_loop_2 (ignore=58390562)
    at c:/msys/home/Dani/emacs/trunk/src/keyboard.c:1170
#101 0x0117c016 in internal_catch (tag=58437378,
    func=0x10f35f2 <command_loop_2>, arg=58390562)
    at c:/msys/home/Dani/emacs/trunk/src/eval.c:1108
#102 0x010f35ce in command_loop ()
    at c:/msys/home/Dani/emacs/trunk/src/keyboard.c:1149
#103 0x010f2d64 in recursive_edit_1 ()
    at c:/msys/home/Dani/emacs/trunk/src/keyboard.c:777
#104 0x010f2f20 in Frecursive_edit ()
    at c:/msys/home/Dani/emacs/trunk/src/keyboard.c:841
#105 0x010f1118 in main (argc=1, argv=0xc213f8)
    at c:/msys/home/Dani/emacs/trunk/src/emacs.c:1637
(gdb)
--8<---------------cut here---------------end--------------->8---

I'll leave the session running, in case you ask me for more details.

Best regards,
Seb

In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2013-12-29 on LEG570
Bzr revision: 115804 [email-masked]
Windowing system distributor `Microsoft Corp.', version 6.2.9200
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'

Important settings:
  value of $LANG: en_US.utf8
  locale-coding-system: cp1252

Major mode: Group

Minor modes in effect:
  shell-dirtrack-mode: t
  helm-match-plugin-mode: t
  helm-occur-match-plugin-mode: t
  global-auto-complete-mode: t
  recentf-mode: t
  gnus-topic-mode: t
  auto-image-file-mode: t
  gnus-undo-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  show-paren-mode: t
  which-function-mode: t
  sml-modeline-mode: t
  global-hi-lock-mode: t
  hi-lock-mode: t
  delete-selection-mode: t
  Info-breadcrumbs-in-mode-line-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t