public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdbserver/win32: fix crash on detach
@ 2023-12-06  0:42 Stefano Moioli
  2023-12-07 16:36 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Moioli @ 2023-12-06  0:42 UTC (permalink / raw)
  To: gdb-patches; +Cc: Stefano Moioli

this patch fixes a crash in gdbserver whenever a process is detached.
the crash is caused by `detach` calling `remove_process` before `win32_clear_inferiors`

error message:

Detaching from process 184
../../gdbserver/inferiors.cc:160: A problem internal to GDBserver has been detec
ted.
remove_process: Assertion `find_thread_process (process) == NULL' failed.

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
---
 gdbserver/win32-low.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc
index 3246957ec44..0ddf60c836f 100644
--- a/gdbserver/win32-low.cc
+++ b/gdbserver/win32-low.cc
@@ -735,9 +735,9 @@ win32_process_target::detach (process_info *process)
     return -1;
 
   DebugSetProcessKillOnExit (FALSE);
+  win32_clear_inferiors ();
   remove_process (process);
 
-  win32_clear_inferiors ();
   return 0;
 }
 
-- 
2.42.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-13 23:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-06  0:42 [PATCH] gdbserver/win32: fix crash on detach Stefano Moioli
2023-12-07 16:36 ` Tom Tromey
2023-12-12 20:19   ` Tom Tromey
2023-12-13 23:57     ` smxdev4

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).