gdbserver/win32: fix crash on detach
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Testing passed
|
Commit Message
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(-)
Comments
>>>>> "Stefano" == Stefano Moioli <smxdev4@gmail.com> writes:
Stefano> this patch fixes a crash in gdbserver whenever a process is detached.
Stefano> the crash is caused by `detach` calling `remove_process` before `win32_clear_inferiors`
Thank you for the patch. This looks good to me.
Approved-By: Tom Tromey <tom@tromey.com>
If you aren't able to push it, let me know and I will do it.
If you plan to do more work on gdb, we should probably get you started
on the copyright assignment work. Let me know.
Tom
>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:
Tom> If you aren't able to push it, let me know and I will do it.
I didn't hear back, so I'm pushing this now.
Tom
Sorry for the late reply, and thanks for pushing it, as I'm not able to push
directly to the gdb repository.
Regards
Stefano
-----Original Message-----
From: Tom Tromey <tom@tromey.com>
Sent: martedì 12 dicembre 2023 21:20
To: Tom Tromey <tom@tromey.com>
Cc: Stefano Moioli <smxdev4@gmail.com>; gdb-patches@sourceware.org
Subject: Re: [PATCH] gdbserver/win32: fix crash on detach
>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:
Tom> If you aren't able to push it, let me know and I will do it.
I didn't hear back, so I'm pushing this now.
Tom
@@ -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;
}