Skip to content

Fix mono debugger thread block when wait for attach #62175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/mono/mono/component/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -10022,7 +10022,7 @@ cmd_to_string (CommandSet set, int command)
static gboolean
wait_for_attach (void)
{
MONO_REQ_GC_SAFE_MODE;
MONO_REQ_GC_UNSAFE_MODE;

#ifndef DISABLE_SOCKET_TRANSPORT
if (listen_fd == -1) {
Expand All @@ -10031,8 +10031,10 @@ wait_for_attach (void)
}

/* Block and wait for client connection */
MONO_ENTER_GC_SAFE;
conn_fd = socket_transport_accept (listen_fd);

MONO_EXIT_GC_SAFE;

PRINT_DEBUG_MSG (1, "Accepted connection on %d\n", conn_fd);
if (conn_fd == -1) {
PRINT_DEBUG_MSG (1, "[dbg] Bad client connection\n");
Expand Down