Uh oh!
There was an error while loading. Please reload this page.
gh-141786: Fix missing parent executor during JIT trace - #142344
Conversation
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 issue pythongh-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.
caje731
commented
Dec 6, 2025
@Fidget-Spinner who the issue is currently assigned to has helped me with this PR. |
Fidget-Spinner
commented
Dec 6, 2025
@devdanzin can we use your repro as a test case please? |
devdanzin
commented
Dec 6, 2025
Sure, in this case and any others, whenever you want. |
Fidget-Spinner
commented
Dec 6, 2025
@caje731 please add a test case to |
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. |
@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 issue gh-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.