Subject: RE: bug#12774: RE: bug#12774: 24.2.50; EMACS 24.2.50.1 crashing‏

From: Vincent Belaïche <[email-masked]>
Date: Sat, 3 Nov 2012 18:41:31 +0100

Ok,

I did now exactly as you said in the first place: I launched only one instance of emacs, got its PID from the task manager, got it crashed, and then connected the gdb to it, and then got the backtrace.

I was not doing this way before, but rather launched emacs via `gdb --exec=...emacs'. This is because there is no systematic way to get the crash happen. Sometimes it happens, and sometimes not. It seems to have to do with some real time condition, like some race between two processes. So it seemed to me that it was easier to have it crashed when emacs is run from the debugger, rather run it, and then connect the debugger. I must say that I have no certainty about that. Indeed, the crash happens rather unpredictably. So, anyway, the only truth is the trace below.

Thank you very much for you kind help.

  Vincent.

PS: maybe there is some issue with my current installation, I mean that I may have some lisp file that was not re-byte-compiled. I have recently switched from a precompiled emacs to a bzr build because my JDEE was broken.

============= Log below ============================
c:\Documents and Settings\Vincent>gdb -p 2896

gdb -p 2896
GNU gdb (GDB) 7.4
Copyright (C) 2012 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-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Attaching to process 2896
[New Thread 2896.0x98]
[New Thread 2896.0xa9c]
[New Thread 2896.0x984]
[New Thread 2896.0x9c0]
Reading symbols from C:\Programme\GNU\Emacs\bin\emacs.exe...done.
(gdb) thread apply all bt

Thread 4 (Thread 2896.0x9c0):
#0  0x7c91120f in ntdll!DbgUiConnectToDbg ()
   from C:\WINDOWS\system32\ntdll.dll
#1  0x7c962119 in ntdll!KiIntSystemCall () from C:\WINDOWS\system32\ntdll.dll
#2  0x00000005 in ?? ()
#3  0x00000004 in ?? ()
#4  0x00000001 in ?? ()
#5  0x64c8ffd0 in ?? ()
#6  0x00000000 in ?? ()

Thread 3 (Thread 2896.0x984):
#0  0x7c91e514 in ntdll!LdrAccessResource ()
   from C:\WINDOWS\system32\ntdll.dll
#1  0x7e3991be in USER32!GetProcessWindowStation ()
   from C:\WINDOWS\system32\user32.dll
#2  0x7e3991f1 in USER32!GetMessageW () from C:\WINDOWS\system32\user32.dll
#3  0x010c4402 in w32_msg_pump (msg_buf=<optimized out>) at w32fns.c:2281
#4  0x010c4b2b in w32_msg_worker@4 (arg=0x0) at w32fns.c:2503
#5  0x7c80b729 in KERNEL32!GetModuleFileNameA ()
   from C:\WINDOWS\system32\kernel32.dll
#6  0x00000000 in ?? ()

Thread 2 (Thread 2896.0xa9c):
#0  0x7c91e514 in ntdll!LdrAccessResource ()
   from C:\WINDOWS\system32\ntdll.dll
#1  0x7c91d21a in ntdll!ZwDelayExecution () from C:\WINDOWS\system32\ntdll.dll
#2  0x7c8023f1 in SleepEx () from C:\WINDOWS\system32\kernel32.dll
#3  0x00000000 in ?? ()

Thread 1 (Thread 2896.0x98):
#0  0x7c91e514 in ntdll!LdrAccessResource ()
   from C:\WINDOWS\system32\ntdll.dll
#1  0x7e399418 in WaitMessage () from C:\WINDOWS\system32\user32.dll
#2  0x7e3a770a in USER32!CallMsgFilterW () from C:\WINDOWS\system32\user32.dll
#3  0x7e3a49c4 in USER32!GetCursorFrameInfo ()
   from C:\WINDOWS\system32\user32.dll
#4  0x7e3ba956 in USER32!SoftModalMessageBox ()
   from C:\WINDOWS\system32\user32.dll
#5  0x7e3ba2bc in USER32!MessageBoxIndirectA ()
   from C:\WINDOWS\system32\user32.dll
#6  0x7e3e63fd in USER32!MessageBoxTimeoutW ()
   from C:\WINDOWS\system32\user32.dll
#7  0x7e3e64a2 in USER32!MessageBoxTimeoutA ()
   from C:\WINDOWS\system32\user32.dll
#8  0x7e3d0877 in USER32!MessageBoxExA () from C:\WINDOWS\system32\user32.dll
#9  0x7e3d082f in USER32!MessageBoxA () from C:\WINDOWS\system32\user32.dll
#10 0x010c1661 in emacs_abort () at w32fns.c:7194
#11 0x01172f1a in relinquish () at ralloc.c:358
#12 0x011734dd in r_alloc_sbrk (size=-921600) at ralloc.c:890
#13 r_alloc_sbrk (size=-921600) at ralloc.c:755
#14 0x010fb150 in _free_internal_nolock (ptr=0xc) at gmalloc.c:1156
#15 0x01007d9b in safe_alloca_unwind (arg=54250595) at alloc.c:840
#16 0x0100dcac in unbind_to (count=113, value=54220826) at eval.c:3195
#17 0x01104644 in load_charset_map_from_file (control_flag=1, 
    mapfile=<optimized out>, charset=0x13bf4a4) at charset.c:550
#18 load_charset (charset=0x13bf4a4, control_flag=1) at charset.c:642
#19 0x01106c37 in decode_char (charset=<optimized out>, code=<optimized out>)
    at charset.c:1714
#20 0x011525fa in decode_coding_charset (coding=0x82c4ac) at coding.c:5475
#21 0x0115ca82 in decode_coding (coding=<optimized out>) at coding.c:7018
#22 0x0116057c in decode_coding_object (coding=0x82c4ac, src_object=59850081, 
    from=0, from_byte=0, to=1, to_byte=1, dst_object=54220850)
    at coding.c:7665
#23 0x011623ba in code_convert_string (string=59850081, 
    coding_system=<optimized out>, dst_object=54220850, encodep=false, 
    nocopy=false, norecord=false) at coding.c:8947
#24 0x011624ea in Fdecode_coding_string (string=59850081, 
    coding_system=55921714, nocopy=54220826, buffer=54220826) at coding.c:8987
#25 0x0100ee84 in Ffuncall (nargs=3, args=0x82c7b8) at eval.c:2783
#26 0x01071305 in exec_byte_code (bytestr=0, vector=8570808, maxdepth=20, 
    args_template=54220826, nargs=8875904, args=0x0) at bytecode.c:899
#27 0x0100ea3d in funcall_lambda (fun=60080101, nargs=<optimized out>, 
    arg_vector=0x82c93c) at eval.c:3004
#28 0x0100ecf3 in Ffuncall (nargs=2, args=0x82c938) at eval.c:2833
#29 0x0100f1b3 in call1 (fn=60080101, arg1=60164254) at eval.c:2566
#30 0x0103de07 in mapcar1 (leni=2, vals=0x82c9c0, fn=60080101, seq=60164262)
    at fns.c:2312
#31 0x0103ff46 in Fmapcar (function=60080101, sequence=60164262) at fns.c:2382
#32 0x0100eeb9 in Ffuncall (nargs=3, args=0x82ca94) at eval.c:2775
#33 0x01071305 in exec_byte_code (bytestr=0, vector=8571540, maxdepth=12, 
    args_template=54220826, nargs=8875904, args=0x10) at bytecode.c:899
#34 0x010736a6 in Fbyte_code (bytestr=59847329, vector=60034677, maxdepth=12)
    at bytecode.c:474
#35 0x0100e486 in eval_sub (form=60164126) at eval.c:2143
#36 0x01010908 in Fdefvar (args=60164142) at eval.c:689
#37 0x0100e5fc in eval_sub (form=60164150) at eval.c:2085
#38 0x01027627 in readevalloop (readcharfun=54287322, stream=0x77c2fd20, 
    sourcename=59982625, printflag=0, unibyte=54220826, readfun=54220826, 
    start=54220826, end=54220826) at lread.c:1840
#39 0x01028520 in Fload (file=55071825, noerror=54220826, nomessage=54220850, 
    nosuffix=54220826, must_suffix=<optimized out>) at lread.c:1321
#40 0x010412ed in Frequire (feature=59136290, filename=54220826, 
    noerror=54220826) at fns.c:2652
#41 0x0100eea2 in Ffuncall (nargs=2, args=0x82d314) at eval.c:2779
#42 0x01071305 in exec_byte_code (bytestr=0, vector=8573716, maxdepth=40, 
    args_template=54220826, nargs=8875904, args=0xd) at bytecode.c:899
#43 0x010736a6 in Fbyte_code (bytestr=61090145, vector=60310157, maxdepth=40)
    at bytecode.c:474
#44 0x0100e486 in eval_sub (form=61185742) at eval.c:2143
#45 0x01027627 in readevalloop (readcharfun=54287322, stream=0x77c2fd00, 
    sourcename=61090065, printflag=0, unibyte=54220826, readfun=54220826, 
    start=54220826, end=54220826) at lread.c:1840
#46 0x01028520 in Fload (file=18793169, noerror=54220826, nomessage=54220850, 
    nosuffix=54220826, must_suffix=<optimized out>) at lread.c:1321
#47 0x010412ed in Frequire (feature=56519570, filename=54220826, 
    noerror=54220826) at fns.c:2652
#48 0x0100eea2 in Ffuncall (nargs=2, args=0x82dad4) at eval.c:2779
#49 0x01071305 in exec_byte_code (bytestr=0, vector=8575700, maxdepth=20, 
    args_template=54220826, nargs=8875904, args=0xd) at bytecode.c:899
#50 0x010736a6 in Fbyte_code (bytestr=61280625, vector=54705621, maxdepth=20)
    at bytecode.c:474
#51 0x0100e486 in eval_sub (form=61186254) at eval.c:2143
#52 0x01027627 in readevalloop (readcharfun=54287322, stream=0x77c2fce0, 
    sourcename=61281105, printflag=0, unibyte=54220826, readfun=54220826, 
    start=54220826, end=54220826) at lread.c:1840
#53 0x01028520 in Fload (file=58011345, noerror=54220826, nomessage=54220850, 
    nosuffix=54220826, must_suffix=<optimized out>) at lread.c:1321
#54 0x010412ed in Frequire (feature=55826890, filename=54220826, 
    noerror=54220826) at fns.c:2652
#55 0x0100e486 in eval_sub (form=61188470) at eval.c:2143
#56 0x0100e7c3 in Fprogn (args=61188590) at eval.c:359
#57 0x0100e5fc in eval_sub (form=61188606) at eval.c:2085
#58 0x01027627 in readevalloop (readcharfun=59400709, stream=0x0, 
    sourcename=59693425, printflag=0, unibyte=54220826, readfun=54220826, 
    start=54220826, end=54220826) at lread.c:1840
#59 0x01027d62 in Feval_buffer (buffer=59400709, printflag=54220826, 
    filename=59658273, unibyte=54220826, do_allow_print=54220850)
    at lread.c:1901
#60 0x0100ee5f in Ffuncall (nargs=6, args=0x82e484) at eval.c:2788
#61 0x01071305 in exec_byte_code (bytestr=0, vector=8578180, maxdepth=24, 
    args_template=54220826, nargs=8875904, args=0x0) at bytecode.c:899
#62 0x0100ea3d in funcall_lambda (fun=18548805, nargs=<optimized out>, 
    arg_vector=0x82e610) at eval.c:3004
#63 0x0100ecf3 in Ffuncall (nargs=5, args=0x82e60c) at eval.c:2833
#64 0x0100f11a in call4 (fn=55913386, arg1=59658273, arg2=59658273, 
    arg3=54220826, arg4=54220850) at eval.c:2615
#65 0x01028245 in Fload (file=18830849, noerror=54220826, nomessage=54220850, 
    nosuffix=54220826, must_suffix=<optimized out>) at lread.c:1261
#66 0x01010449 in Fautoload_do_load (fundef=18830918, funname=55982442, 
    macro_only=54220826) at eval.c:1971
#67 0x0100ec8a in Ffuncall (nargs=1, args=0x82ebe4) at eval.c:2836
#68 0x01071305 in exec_byte_code (bytestr=0, vector=8580068, maxdepth=12, 
    args_template=54220826, nargs=8875904, args=0x17) at bytecode.c:899
#69 0x0100ea3d in funcall_lambda (fun=18661501, nargs=<optimized out>, 
    arg_vector=0x82ed58) at eval.c:3004
#70 0x0100ecf3 in Ffuncall (nargs=3, args=0x82ed54) at eval.c:2833
#71 0x01071305 in exec_byte_code (bytestr=0, vector=8580436, maxdepth=16, 
    args_template=54220826, nargs=8875904, args=0x1a) at bytecode.c:899
#72 0x010736a6 in Fbyte_code (bytestr=18661289, vector=18661317, maxdepth=16)
    at bytecode.c:474
#73 0x0100e486 in eval_sub (form=18661278) at eval.c:2143
#74 0x0100d658 in internal_catch (tag=56401354, func=0x100e006 <eval_sub>, 
    arg=18661278) at eval.c:1059
#75 0x01071978 in exec_byte_code (bytestr=0, vector=8580968, maxdepth=24, 
    args_template=54220826, nargs=8875904, args=0x82ef64) at bytecode.c:1080
#76 0x0100ea3d in funcall_lambda (fun=18660869, nargs=<optimized out>, 
    arg_vector=0x82f070) at eval.c:3004
#77 0x0100df52 in apply_lambda (fun=18660869, args=<optimized out>)
    at eval.c:2881
#78 0x0100e1af in eval_sub (form=18655582) at eval.c:2212
#79 0x01010d9f in internal_lisp_condition_case (var=56062506, 
    bodyform=18655582, handlers=18655590) at eval.c:1242
#80 0x01071cf7 in exec_byte_code (bytestr=0, vector=8581660, maxdepth=16, 
    args_template=54220826, nargs=8875904, args=0x82f214) at bytecode.c:1095
#81 0x0100ea3d in funcall_lambda (fun=18655429, nargs=<optimized out>, 
    arg_vector=0x82f398) at eval.c:3004
#82 0x0100ecf3 in Ffuncall (nargs=2, args=0x82f394) at eval.c:2833
#83 0x01071305 in exec_byte_code (bytestr=0, vector=8582036, maxdepth=20, 
    args_template=54220826, nargs=8875904, args=0x0) at bytecode.c:899
#84 0x0100ea3d in funcall_lambda (fun=18654749, nargs=<optimized out>, 
    arg_vector=0x82f518) at eval.c:3004
#85 0x0100ecf3 in Ffuncall (nargs=3, args=0x82f514) at eval.c:2833
#86 0x01071305 in exec_byte_code (bytestr=0, vector=8582420, maxdepth=12, 
    args_template=54220826, nargs=8875904, args=0x0) at bytecode.c:899
#87 0x0100ea3d in funcall_lambda (fun=18653245, nargs=<optimized out>, 
    arg_vector=0x82f688) at eval.c:3004
#88 0x0100ecf3 in Ffuncall (nargs=7, args=0x82f684) at eval.c:2833
#89 0x01071305 in exec_byte_code (bytestr=0, vector=8582788, maxdepth=32, 
    args_template=54220826, nargs=8875904, args=0x200) at bytecode.c:899
#90 0x0100ea3d in funcall_lambda (fun=18652421, nargs=<optimized out>, 
    arg_vector=0x82f818) at eval.c:3004
#91 0x0100ecf3 in Ffuncall (nargs=5, args=0x82f814) at eval.c:2833
#92 0x01071305 in exec_byte_code (bytestr=0, vector=8583188, maxdepth=24, 
    args_template=54220826, nargs=8875904, args=0x0) at bytecode.c:899
#93 0x0100ea3d in funcall_lambda (fun=18648829, nargs=<optimized out>, 
    arg_vector=0x82f998) at eval.c:3004
#94 0x0100ecf3 in Ffuncall (nargs=2, args=0x82f994) at eval.c:2833
#95 0x01071305 in exec_byte_code (bytestr=0, vector=8583572, maxdepth=8, 
    args_template=0, nargs=8875904, args=0x82fb24) at bytecode.c:899
#96 0x0100e94d in funcall_lambda (fun=61119941, nargs=0, arg_vector=0x82fb24)
    at eval.c:2938
#97 0x0100ecf3 in Ffuncall (nargs=1, args=0x82fb20) at eval.c:2833
#98 0x0100f29c in apply1 (fn=61087154, arg=54220826) at eval.c:2533
#99 0x01073a18 in Fcall_interactively (function=61087154, 
    record_flag=54220826, keys=54242221) at callint.c:377
#100 0x0100eea2 in Ffuncall (nargs=4, args=0x82fc50) at eval.c:2779
#101 0x0100f155 in call3 (fn=54332138, arg1=61087154, arg2=54220826, 
    arg3=54220826) at eval.c:2597
#102 0x010502d6 in command_loop_1 () at keyboard.c:1602
#103 0x0100d713 in internal_condition_case (bfun=0x104ffbc <command_loop_1>, 
    handlers=54271410, hfun=0x104801b <cmd_error>) at eval.c:1288
#104 0x01046c1c in command_loop_2 (ignore=54220826) at keyboard.c:1179
#105 0x0100d658 in internal_catch (tag=54261266, 
    func=0x1046bfc <command_loop_2>, arg=54220826) at eval.c:1059
#106 0x01047bd6 in command_loop () at keyboard.c:1158
#107 recursive_edit_1 () at keyboard.c:779
#108 0x01047e5e in Frecursive_edit () at keyboard.c:843
#109 0x011949b9 in main (argc=<optimized out>, argv=0xab3fe8) at emacs.c:1525
(gdb) 

================= end of log ======================================

> Date: Sat, 3 Nov 2012 16:16:01 +0200
> From: [email-masked]
> Subject: Re: RE: bug#12774: RE: bug#12774: 24.2.50; EMACS 24.2.50.1 crashing‏
> To: [email-masked]
> CC: [email-masked]
> 
> > From: Vincent Belaïche <[email-masked]>
> > CC: <[email-masked]>
> > Date: Sat, 3 Nov 2012 14:47:52 +0100
> > 
> > I did the experiment again, after a few attempts I got it crash, and typed  "thread apply all bt".
> > 
> > 
> > 
> > The output " Program received signal SIGTRAP, Trace/breakpoint trap." is printed immediately I click on "Oui" (Yes) button in the dialog that appears when the crash occurs.
> 
> If you run Emacs under GDB, you should do this:
> 
>  (gdb) break emacs_abort
>  (gdb) run
> 
> Then Emacs will stop in emacs_abort instead of popping up the abort
> dialog, and you will be able to produce a more meaningful backtrace.