public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdbserver/win32: fix crash on detach
@ 2023-12-12 20:20 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-12-12 20:20 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fa659800b009df1f0bdb0c5d24eec047fb9c3fa0

commit fa659800b009df1f0bdb0c5d24eec047fb9c3fa0
Author: Stefano Moioli <smxdev4@gmail.com>
Date:   Wed Dec 6 01:42:19 2023 +0100

    gdbserver/win32: fix crash on detach
    
    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.
    
    Approved-By: Tom Tromey <tom@tromey.com>

Diff:
---
 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 2711fb335f6..90d9510c7b9 100644
--- a/gdbserver/win32-low.cc
+++ b/gdbserver/win32-low.cc
@@ -734,9 +734,9 @@ win32_process_target::detach (process_info *process)
     return -1;
 
   DebugSetProcessKillOnExit (FALSE);
+  win32_clear_inferiors ();
   remove_process (process);
 
-  win32_clear_inferiors ();
   return 0;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-12 20:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-12 20:20 [binutils-gdb] gdbserver/win32: fix crash on detach Tom Tromey

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).