8000 BUG: disable garbage collector during memory allocation hook by juliantaylor · Pull Request #4841 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: disable garbage collector during memory allocation hook #4841

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

Merged
merged 1 commit into from
Jul 5, 2014

Conversation

juliantaylor
Copy link
Contributor

When a cython object contains numpy arrays the pure python allocation
hook can trigger during cythons dealloc method and trigger a second
deletion of the object currently being deleted.
To minimize the probabily that that happens disable the garbage
collector during the hook.
As this involves python calls it is still possible that a double delete
occurs but chances are lowered, a proper solution would be C only hook
like python 3.4 tracemalloc module.

Closes gh-4834

When a cython object contains numpy arrays the pure python allocation
hook can trigger during cythons __dealloc__ method and trigger a second
deletion of the object currently being deleted.
To minimize the probabily that that happens disable the garbage
collector during the hook.
As this involves python calls it is still possible that a double delete
occurs but chances are lowered, a proper solution would be C only hook
like python 3.4 tracemalloc module.

Closes numpygh-4834
@charris
Copy link
Member
charris commented Jul 5, 2014

LGTM, thanks Julian.

charris added a commit that referenced this pull request Jul 5, 2014
BUG: disable garbage collector during memory allocation hook
@charris charris merged commit 81242f6 into numpy:master Jul 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation fault when using memory allocation tracker
2 participants
0