Subject: Re: bug#60556: 29.0.60; Fatal error accurred when editing init.el with flymake enabled on Windows 10

From: Eason Huang <[email-masked]>
Date: Sun, 22 Jan 2023 19:22:23 +0800

Eli Zaretskii <[email-masked]> writes:

>> Date: Wed, 04 Jan 2023 22:44:22 +0800
>> From: Eason Huang <[email-masked]>
>>
>> Thread 44 received signal SIGTRAP, Trace/breakpoint trap.
>> [Switching to Thread 7544.0x32a0]
>> 0x00007fff84fd0bb1 in ntdll!DbgBreakPoint () from C:\Windows\SYSTEM32\ntdll.dll
>> (gdb) bt
>> #0  0x00007fff84fd0bb1 in ntdll!DbgBreakPoint () from C:\Windows\SYSTEM32\ntdll.dll
>> #1  0x00007fff84ffcc2e in ntdll!DbgUiRemoteBreakin () from C:\Windows\SYSTEM32\ntdll.dll
>> #2  0x00007fff84947614 in KERNEL32!BaseThreadInitThunk () from C:\Windows\System32\kernel32.dll
>> #3  0x00007fff84f826a1 in ntdll!RtlUserThreadStart () from C:\Windows\SYSTEM32\ntdll.dll
>> #4  0x0000000000000000 in ?? ()
>> Backtrace stopped: previous frame inner to this frame (corrupt stack?)
>> (gdb) q
>> A debugging session is active.
>
> At this point, instead of "q", please type:
>
>   (gdb) thread 1
>   (gdb) bt
>
> and post the results here.
>
>
>
>

Hi Eli,

I tried to debug with GDB again and reproduce the issue and the result
is as bellow:

```
➜ ~  ps -name emacs

 NPM(K)    PM(M)      WS(M)     CPU(s)      Id  SI ProcessName
 ------    -----      -----     ------      --  -- -----------
     21    47.24      52.12       7.62   16764   1 emacs

➜ ~  mingw

Aqua@DESKTOP-VIHxxxx MINGW64 ~
$ gdb -p 16764
GNU gdb (GDB) 12.1
Copyright (C) 2022 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 "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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".
Attaching to process 16764
[New Thread 16764.0x20f4]
[New Thread 16764.0x16f4]
[New Thread 16764.0x1a18]
Reading symbols from C:\opt\emacs\bin\emacs.exe...
(gdb) c
Continuing.
[Thread 16764.0x1a18 exited with code 0]
[New Thread 16764.0x5230]
[New Thread 16764.0x1ac4]
[Thread 16764.0x1ac4 exited with code 0]
[Thread 16764.0x5230 exited with code 0]
[New Thread 16764.0x525c]
[New Thread 16764.0x442c]
[Thread 16764.0x442c exited with code 0]
[Thread 16764.0x525c exited with code 0]
[New Thread 16764.0x539c]
[New Thread 16764.0x64]
[Thread 16764.0x64 exited with code 0]
[Thread 16764.0x539c exited with code 0]
[New Thread 16764.0x1aac]
[New Thread 16764.0x5094]
[Thread 16764.0x5094 exited with code 0]
[Thread 16764.0x1aac exited with code 0]
[New Thread 16764.0x46cc]
[New Thread 16764.0x50a8]
[New Thread 16764.0xdb0]
[New Thread 16764.0x1114]
[Thread 16764.0x50a8 exited with code 0]
[Thread 16764.0x46cc exited with code 0]
[Thread 16764.0x1114 exited with code 0]
[Thread 16764.0xdb0 exited with code 0]
[New Thread 16764.0x536c]
[New Thread 16764.0x3f7c]
[New Thread 16764.0x1040]
[New Thread 16764.0x28b0]
[Thread 16764.0x3f7c exited with code 0]
[Thread 16764.0x536c exited with code 0]
[Thread 16764.0x28b0 exited with code 0]
[Thread 16764.0x1040 exited with code 0]
[New Thread 16764.0x2ca4]
[New Thread 16764.0x3f1c]
[New Thread 16764.0x4048]
[New Thread 16764.0x5148]
[Thread 16764.0x5148 exited with code 0]
[Thread 16764.0x4048 exited with code 0]
[Thread 16764.0x3f1c exited with code 0]
[Thread 16764.0x2ca4 exited with code 0]
[New Thread 16764.0x1184]

Thread 25 received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 16764.0x1184]
0x00007ffda9a90bb1 in ntdll!DbgBreakPoint () from C:\Windows\SYSTEM32\ntdll.dll
(gdb) thread 1
[Switching to thread 1 (Thread 16764.0x2de4)]
#0  0x00007ffda790a104 in win32u!NtUserMsgWaitForMultipleObjectsEx () from C:\Windows\System32\win32u.dll
(gdb) bt
#0  0x00007ffda790a104 in win32u!NtUserMsgWaitForMultipleObjectsEx () from C:\Windows\System32\win32u.dll
#1  0x00007ffda91207ee in USER32!MsgWaitForMultipleObjectsEx () from C:\Windows\System32\user32.dll
#2  0x00007ff6123470b0 in sys_select (nfds=<optimized out>, rfds=0x72a17fe960, wfds=0x72a17fe968,
    efds=<optimized out>, timeout=<optimized out>, ignored=0x0) at w32proc.c:2504
#3  0x00007ff6122f6d63 in really_call_select (arg=0x72a17fe6e0) at thread.c:612
#4  0x00007ff6122f778e in flush_stack_call_func (arg=0x72a17fe7c0, func=0x7ff6122f6d00 <really_call_select>)
    at lisp.h:4232
#5  thread_select (func=<optimized out>, max_fds=<optimized out>, rfds=rfds@entry=0x72a17fe960,
    wfds=wfds@entry=0x72a17fe968, efds=<optimized out>, efds@entry=0x0, timeout=<optimized out>,
    timeout@entry=0x72a17fe970, sigmask=<optimized out>, sigmask@entry=0x0) at thread.c:644
#6  0x00007ff6122cf1b4 in wait_reading_process_output (time_limit=<optimized out>, nsecs=<optimized out>,
    read_kbd=<optimized out>, read_kbd@entry=-1, do_display=do_display@entry=true, wait_for_cell=<optimized out>,
    wait_for_cell@entry=0x0, wait_proc=<optimized out>, wait_proc@entry=0x0, just_wait_proc=<optimized out>,
    just_wait_proc@entry=0) at process.c:5693
#7  0x00007ff61211bea5 in sit_for (timeout=timeout@entry=0xb6, reading=reading@entry=true,
    display_option=display_option@entry=1) at dispnew.c:6252
#8  0x00007ff6121f9a75 in read_char (commandflag=<optimized out>, map=<optimized out>, map@entry=0x2044bc40db3,
    prev_event=<optimized out>, used_mouse_menu=<optimized out>, used_mouse_menu@entry=0x72a17ff20b,
    end_time=<optimized out>, end_time@entry=0x0) at keyboard.c:2871
#9  0x00007ff6121fb072 in read_key_sequence (keybuf=keybuf@entry=0x72a17ff390, prompt=prompt@entry=0x0,
    dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=can_return_switch_frame@entry=true,
    fix_current_buffer=fix_current_buffer@entry=true, prevent_redisplay=prevent_redisplay@entry=false)
    at keyboard.c:10073
#10 0x00007ff6121fc69c in command_loop_1 () at keyboard.c:1375
#11 0x00007ff61227580d in internal_condition_case (bfun=bfun@entry=0x7ff6121fc4b0 <command_loop_1>,
    handlers=handlers@entry=0x90, hfun=hfun@entry=0x7ff6121f1520 <cmd_error>) at eval.c:1474
#12 0x00007ff6121e8bde in command_loop_2 (handlers=0x90) at keyboard.c:1124
--Type <RET> for more, q to quit, c to continue without paging--

```

-- 
Eason Huang