Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix: profiling.sampling may cause assertion ``!(has_gil &&
gil_requested)``
6 changes: 2 additions & 4 deletions Modules/_remote_debugging/threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@

// Check GIL status
int has_gil = 0;
int gil_requested = 0;

Check warning on line 318 in Modules/_remote_debugging/threads.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

variable ‘gil_requested’ set but not used [-Wunused-but-set-variable]

Check warning on line 318 in Modules/_remote_debugging/threads.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

variable ‘gil_requested’ set but not used [-Wunused-but-set-variable]
#ifdef Py_GIL_DISABLED
int active = GET_MEMBER(_thread_status, ts, unwinder->debug_offsets.thread_state.status).active;
has_gil = active;
Expand All @@ -335,12 +335,10 @@
#endif
if (has_gil) {
status_flags |= THREAD_STATUS_HAS_GIL;
// gh-142207 for remote debugging.
gil_requested = 0;
}

// Assert that we never have both HAS_GIL and GIL_REQUESTED set at the same time
// This would indicate a race condition in the GIL state tracking
assert(!(has_gil && gil_requested));

// Check CPU status
long pthread_id = GET_MEMBER(long, ts, unwinder->debug_offsets.thread_state.thread_id);

Expand Down
Loading