Skip to content

Commit 3db7bf2

Browse files
authored
gh-142207: remove assertions incompatible under profiling.sampling (#142331)
1 parent 7099af8 commit 3db7bf2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix: profiling.sampling may cause assertion ``!(has_gil &&
2+
gil_requested)``

Modules/_remote_debugging/threads.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,10 @@ unwind_stack_for_thread(
339339
#endif
340340
if (has_gil) {
341341
status_flags |= THREAD_STATUS_HAS_GIL;
342+
// gh-142207 for remote debugging.
343+
gil_requested = 0;
342344
}
343345

344-
// Assert that we never have both HAS_GIL and GIL_REQUESTED set at the same time
345-
// This would indicate a race condition in the GIL state tracking
346-
assert(!(has_gil && gil_requested));
347-
348346
// Check CPU status
349347
long pthread_id = GET_MEMBER(long, ts, unwinder->debug_offsets.thread_state.thread_id);
350348

0 commit comments

Comments
 (0)