-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-142476: fix memory leak when creating JIT executors #142492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I believe a news entry is not required for this change. |
Fidget-Spinner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, great catch!
Could you please add a comment(review below) so that we know why this is needed?
|
The failing Windows test is likely because of https://github.com/python/cpython/pull/137016/files. Could you please try pulling in the changes from there? |
|
Yes, applying the changes from #137016 fixes the Windows crash. |
|
We need this to be merged first https://github.com/python/cpython/pull/137016/files |
|
Also, I'm not sure I get why we DECREF Maybe @markshannon can shed a light to this, because of #118459 |
Detach is for removing the executor from a code object. The code object owns a strong reference to the executor so we must decref it. |
|
@Fidget-Spinner Thanks! |
|
The crashes were caused by a double untrack exposed by the fix.
The fix: Guard the untrack call with |
|
@Fidget-Spinner I've added the news entry. |
|
So I'm gonna leave this around for a few more days. However could you please add a code comment above the if that tp_traverse might untrack the onject once it breaks cycles, so we need to not double-untrack it please? |
|
Got it, sounds good — I’ll do that. |
|
@sergey-miryanov The project doesn't even build right now, so I'm unable to verify it. I'm building Python from the Build Logs
|
|
@ashm-dev does the project build if you apply this patch here to main? |
|
@Fidget-Spinner No, it doesn't build even with my patch applied. It looks like the JIT is broken again. |
Fidget-Spinner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not broken (apart from the refcount leak I think), the current patch seems to be breaking it.
|
But it doesn't build on main either, even without my patch. I posted the logs above. |
sergey-miryanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks!
@ashm-dev I think you're misunderstanding me. I'm asking if it builds with this patch currently on this branch? |
|
@Fidget-Spinner Yes, it builds! |
|
I'm seeing GHA segfaults in x86_64-pc-windows-msvc/msvc (Debug) on this commit and the subsequent one, but not on earlier commits: |
Uh oh!
There was an error while loading. Please reload this page.