-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
visit_decref(): add an assertion to check that the object is not freed #82251
Comments
This issue is related to bpo-36389 "Add gc.enable_object_debugger(): detect corrupted Python objects in the GC. I propose to call _PyObject_IsFreed() in visit_decref() in debug mode, to get a better error message if something goes wrong. visit_decref() is commonly found in C traceback (ex: gdb backtrace) of bugs related to the garbage collector. |
Example with attached bpo-38037-bug.patch: you can apply this patch on the master branch to reintroduce bpo-38037 bug. vstinner@apu$ git apply bpo-38037-bug.patch Without PR 15782: vstinner@apu$ ./python -c pass With PR 15782: vstinner@apu$ ./python -c pass Current thread 0x00007f171a280740 (most recent call first): The bug is catched earlier. And Python provides more information. |
Should this be closed now? |
Please keep it open, I have a few more local changess to enhance Py_FatalError() :-) I would like to reuse the bpo number. |
msg351473 example with the new assertion and enhanced debug functions: Current thread 0x00007ff010841740 (most recent call first):
|
Ok, I pushed the most important changes that I wanted to push. I close the issue. |
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: