https://bugs.winehq.org/show_bug.cgi?id=55187
Bug ID: 55187 Summary: winedbg --auto crashes if target process terminates after attaching. Product: Wine Version: 8.11 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winedbg Assignee: wine-bugs@winehq.org Reporter: bernhardu@mailbox.org Distribution: ---
Tried to do some investigation of bug 54240. There MaLauncher.exe hit a unimplemented function, therefore raises a 'windbg --auto' process. Unfortunately somehow the MaLauncher.exe manages to terminate, therefore winedbg receives a EXIT_PROCESS_DEBUG_EVENT that sets dbg_curr_process to NULL, while winedbg is in the middle of the --auto processing. Therefore hitting close or show details leads to a crash in winedbg.
Thread 1 received signal SIGSEGV, Segmentation fault. 0x0041bff1 in output_system_info () at programs/winedbg/tgt_active.c:876 876 if (!IsWow64Process( dbg_curr_process->handle, &is_wow64 )) is_wow64 = FALSE; (rr) bt #0 0x0041bff1 in output_system_info () at programs/winedbg/tgt_active.c:876 #1 dbg_active_auto () at programs/winedbg/tgt_active.c:991 #2 0x0043a377 in main () at programs/winedbg/winedbg.c:729 ... (rr) print dbg_curr_process $1 = (struct dbg_process *) 0x0
https://bugs.winehq.org/show_bug.cgi?id=55187
--- Comment #1 from Bernhard Übelacker bernhardu@mailbox.org --- Following MR would at least avoid the crash in winedbg: https://gitlab.winehq.org/wine/wine/-/merge_requests/3231
https://bugs.winehq.org/show_bug.cgi?id=55187
--- Comment #2 from Bernhard Übelacker bernhardu@mailbox.org --- Created attachment 74785 --> https://bugs.winehq.org/attachment.cgi?id=74785 trace with +pid,+timestamp,+winedbg,+process (git 884cff821 plus trace in NtTerminateProcess)
https://bugs.winehq.org/show_bug.cgi?id=55187
--- Comment #3 from Bernhard Übelacker bernhardu@mailbox.org --- Just a short addition: It looks like MaLauncher.exe creates some threads, where at least one checks from time to time by IsDebuggerPresent if there is a debugger attached. This thread seems after the call to the unimplemented function in the other thread and the start of 'winedbg --auto' suspended. But ContinueDebugEvent releases this thread, IsDebuggerPresent returns true, and ExitProcess is called. Unfortunately while winedbg is still in the middle of its work.
https://bugs.winehq.org/show_bug.cgi?id=55187
--- Comment #4 from Bernhard Übelacker bernhardu@mailbox.org --- Created attachment 74789 --> https://bugs.winehq.org/attachment.cgi?id=74789 interactive test
Modification to kernel32 test to better show the issue.
https://bugs.winehq.org/show_bug.cgi?id=55187
Bernhard Übelacker bernhardu@mailbox.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED
--- Comment #5 from Bernhard Übelacker bernhardu@mailbox.org --- Got fixed by following commit (and two before) from Eric Pouech: https://gitlab.winehq.org/wine/wine/-/commit/fdd1c1c7765a2d863975fb1ed9e310f...
https://bugs.winehq.org/show_bug.cgi?id=55187
Bernhard Übelacker bernhardu@mailbox.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |fdd1c1c7765a2d863975fb1ed9e | |310f453934ec5
https://bugs.winehq.org/show_bug.cgi?id=55187
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.13.