Uh oh!
There was an error while loading. Please reload this page.
Improve the error reporting for inc_ref GIL failures - #4427
Conversation
EthanSteinberg
commented
Dec 27, 2022
@Skylion007@henryiii I know this sucks, but I think you might want to push this out ASAP given all the issues with 2.10.2 Might be worth rereleasing 2.10.2 with this patch or pushing out 2.10.3 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
rwgk
left a comment
There was a problem hiding this comment.
Sorry a lot of comments, but really only about details. The general approach is great! Thanks again for jumping in making this better.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
rwgk
commented
Dec 28, 2022
I don't remember seeing the pypy-3.7 • windows-2022 • x64 CI failure. Rerunning to be sure it's a flake. |
I believe all of the comments are now resolved. Thanks for the feedback and reviews! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
rwgk
commented
Dec 30, 2022
Could someone else please merge this? (@henryiii or @Skylion007) |
…pointer. Context: * pybind/pybind11#4427 (comment) > I don't think your logic ... is actually correct? I don't think it would handle metaclasses right. PiperOrigin-RevId: 498690703
* First * Fixs * Improve * Additional assertions comment * Improve docs
Description
In 2.10.2, we added a new feature to catch UB when inc_ref or dec_ref are called without the GIL. This functionality works great, but the error reporting via an exception is very suboptimal as those exceptions get called in weird environments, triggering weird crashes.
This PR adds some good old-fashioned fprintf statements to help users understand what is going on. I want to use fprintf here because that's generally the most reliable method in all sorts of environments (especially when iostream might not be initialized properly).
Closes#4426
Suggested changelog entry: