-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Not all types have "trashcan" protection and tp_dealloc can overflow stack #124715
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
Comments
Replace _PyObject_GC_UNTRACK() with PyObject_GC_UnTrack() to not fail if the method was already untracked.
Regarding untracking, when I was working on my "integrate trashcan PR", I started wondering if Maybe we should profile this and see if it has any performance impact at all? There has been many bugs related to this over the years. |
…k() (python#133199)" This reverts commit 662dd29. The root issue was fixed by the commit f554237.
We occasionally fix these kinds of bugs, like GH-102356. However, the fix by adding the "trashcan" macros to the tp_dealloc method only fixes that specific type. It would be better to have a more generic fix. A crash due to the C stack overflow leaves the user mystified as to what the problem is and these kinds of bugs could be hard to reproduce (requiring long chains of objects calling tp_dealloc recursively).
Linked PRs
Py_Dealloc
#132280The text was updated successfully, but these errors were encountered: