-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Fix and improve errors handling in the garbage collector #77803
Comments
There are following bugs in the garbage collector.
|
PR 7126 adds several assert(!PyErr_Occurred()) for earlier detection of leaked exceptions. And the failure in adding to gc.garbage is no longer fatal. It is better to not add an object to gc.garbage in this iteration than crash when we run garbage collection when have no memory. |
See bpo-33712, bpo-33713 and bpo-33714 for three cases in the stdlib where an exception can be set in the tp_clear handler. This caused a crash in the garbage collector, or can be just silenced if failed at the shutdown stage. In the master branch it will cause writing a traceback to the stderr. It would be better to handle exceptions locally in the tp_clear handlers. But perhaps it may be worth to handle leaked exceptions in the garbage collector too. I'm just not sure about a solution. Writing a traceback to the stderr can cause a regression if it was just silenced before. But silencing it can hide bugs. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: