gh-111178: Avoid calling functions from incompatible pointer types in `longobject.c` by picnixz · Pull Request #122972 · python/cpython
I'll need a core dev to check whether this would fix the AMD64 Arch Linux Usan PR build bot. I think it should at least fix this compilation error but I'm not sure if there won't be more compilations errors.
@encukou Tell me if you want a NEWS entry for this one by the way (for me, it's an internal change that shouldn't affect the end user but feel free to argue). By the way, I closed python/buildmaster-config#517 in favor of keeping the meta issue even though the meta issue was only about warnings whereas the other issue was about the buildbot failure itself (for which the warnings are errors).
Thank you for the fix! It looks good to merge if the buildbot passes.
No NEWS required; I agree with your triage.
So, the fix fixed it but since the compiler early exits, there are more errors appearing:
Objects/object.c:2892:5: runtime error: call to function MemoryError_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
/buildbot/buildarea/pull_request.pablogsal-arch-x86_64.clang-ubsan/build/Objects/exceptions.c:3391: note: MemoryError_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:2892:5 in
Should I try to fix the build bot in one go, or do we just merge this one, then fix compilation errors one by one? (this would affect the title of the PR as well btw and I don't think I'm able to run a build bot myself to check).
(I fear that the build bot will be failing until we fix all those kind of functions with explicit casts...)
See #123004 for the incremental fixes that I will make.
Should I try to fix the build bot in one go, or do we just merge this one, then fix compilation errors one by one?
Let's go for something between that. After a PR is merged, or in a few days, open a new one with however many fixes you have.
Even if it's just one.
I'll merge this PR; it's an improvement.
I don't think I'm able to run a build bot myself to check
Are you able to run USAN on your machine? There are instructions in the devguide (for *nix, though the installation looks very outdated, it should be easier now); also the buildbot logs have the commands to run (but not to install clang).
For this particular issue you can use -fsanitize=function rather than the full -fsanitize=undefined.
picnixz
deleted the
fix-arch-linux-usan-failure
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters