Skip to content
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

gh-111178: Avoid calling functions from incompatible pointer types in longobject.c #122972

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

picnixz
Copy link
Contributor

@picnixz picnixz commented Aug 13, 2024

@picnixz
Copy link
Contributor Author

picnixz commented Aug 13, 2024

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).

@encukou
Copy link
Member

encukou commented Aug 14, 2024

!buildbot Usan

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @encukou for commit cd63f58 🤖

The command will test the builders whose names match following regular expression: Usan

The builders matched are:

  • AMD64 Arch Linux Usan PR

@encukou
Copy link
Member

encukou commented Aug 14, 2024

Thank you for the fix! It looks good to merge if the buildbot passes.

No NEWS required; I agree with your triage.

@picnixz
Copy link
Contributor Author

picnixz commented Aug 14, 2024

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.

@encukou
Copy link
Member

encukou commented Aug 14, 2024

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.

@encukou encukou merged commit fe3e623 into python:main Aug 14, 2024
37 of 38 checks passed
@picnixz picnixz deleted the fix-arch-linux-usan-failure branch August 14, 2024 09:57
blhsing pushed a commit to blhsing/cpython that referenced this pull request Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants