From 5c4bb9b7f6a779351afcdd76f390c572b3c1dc06 Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Mon, 15 Sep 2025 20:09:15 +0530 Subject: [PATCH] gh-137992: fix `PyRefTracer_SetTracer` to start world before returning (#138925) fix deadlock in PyRefTracer_SetTracer --- Objects/object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Objects/object.c b/Objects/object.c index c9bcc0c7b09e..1f10c2531fea 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -3292,6 +3292,7 @@ int PyRefTracer_SetTracer(PyRefTracer tracer, void *data) { if (_PyRuntime.ref_tracer.tracer_func != NULL) { _PyReftracerTrack(NULL, PyRefTracer_TRACKER_REMOVED); if (PyErr_Occurred()) { + _PyEval_StartTheWorldAll(&_PyRuntime); return -1; } } -- 2.47.3