[mypyc] Fix subclass processing in detect_undefined_bitmap#19787
[mypyc] Fix subclass processing in detect_undefined_bitmap#19787JukkaL merged 1 commit intopython:masterfrom
Conversation
Incorrect processing in detect_undefined_bitmap could cause a ValueError exception in emit_undefined_attr_check.
|
Original issue: mypyc/mypyc#1131 I have been encountering this error during builds: The error is curiously non-deterministic. It will often occur, but sometimes it will not, indicating some sort of undefined iteration order makes it show up or skips it. While trying to hunt it down, I have noticed constructs like these in my code-base influence its appearance:
Unfortunately after a number of attempts, I have not actually been able to isolate a test-case, so there is more involved than the example above. My code uses multiple inheritance with traits so that may also be relevant. The issue appears on my own code-base pretty reliably. The first build attempt generally fails for me, but when doing repeated runs on the same unmodified code, within 5 attempts, I usually reach a working build. This PR fixes the issue reliably for me, and it certainly looks to me as if the replaced code was a bug. I have now tested over 50 build rounds on my code-base without a single failure. The full test suite completes without errors locally with this change, CPython 3.12.10. Even without a test-case, if it can be confirmed the original code was wrong, this should be a mergeable PR. |
hauntsaninja
left a comment
There was a problem hiding this comment.
That code definitely looks buggy to me, thanks! (#13532)
Incorrect processing in detect_undefined_bitmap could cause a ValueError exception in emit_undefined_attr_check.
Incorrect processing in detect_undefined_bitmap could cause a ValueError exception in emit_undefined_attr_check.