Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
gh-141786: Fix missing parent executor during JIT trace#142344
gh-141786: Fix missing parent executor during JIT trace#142344caje731 wants to merge 4 commits intopython:mainfrom
Conversation
An executor's trace can point to another executor, forming a graphof traces / executors. Sometimes it is possible while recording atrace that the parent executor is freed / invalidated halfway. Thisleads to the bug described in the issuepythongh-141786, which if leftunfixed could cause a memory leak.This patch checks for the validity of the parent executor as wellas allowing JIT from the cold executor. While the cold executor isnot linked, it is the executor responsible for creating side tracesand we still want to JIT from it.
caje731 commentedDec 6, 2025
@Fidget-Spinner who the issue is currently assigned to has helped me with this PR. |
Fidget-Spinner commentedDec 6, 2025
@devdanzin can we use your repro as a test case please? |
devdanzin commentedDec 6, 2025
Sure, in this case and any others, whenever you want. |
Fidget-Spinner commentedDec 6, 2025
@caje731 please add a test case to |
caje731 commentedDec 8, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I should note that the following simple diff in the test: produces a breakage in the test: At this point I'm unsure if this is related to JIT optimizations, but superficially seems to be just a side-effect of the symbol-conflicts (ab)used in the test. |
Fidget-Spinner commentedDec 11, 2025 • edited by efimov-mikhail
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by efimov-mikhail
Uh oh!
There was an error while loading.Please reload this page.
@markshannon i would like to merge this still. Even with your proposed fix it's possible to invalidate an executor while tracing. This is a separate issue. |
An executor's trace can point to another executor, forming a graph of traces / executors. Sometimes it is possible while recording a trace that the parent executor is freed / invalidated halfway. This leads to the bug described in the issuegh-141786, which if left unfixed could cause a memory leak.
This patch checks for the validity of the parent executor as well as allowing JIT from the cold executor. While the cold executor is not linked, it is the executor responsible for creating side traces and we still want to JIT from it.