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

Add Arch Linux Usan 3.x/ build bot with -fno-sanitize=function #517

Closed
picnixz opened this issue Jul 31, 2024 · 12 comments · Fixed by #519
Closed

Add Arch Linux Usan 3.x/ build bot with -fno-sanitize=function #517

picnixz opened this issue Jul 31, 2024 · 12 comments · Fixed by #519

Comments

@picnixz
Copy link

picnixz commented Jul 31, 2024

Bug report

Bug description:

Tests are broken for build bot Arch Linux Usan 3.x/4532 since the compilation fails with:

Objects/object.c:1071:16: runtime error: call to function long_hash through pointer to incorrect function type 'long (*)(struct _object *)'
/buildbot/buildarea/3.x.pablogsal-arch-x86_64.clang-ubsan/build/Objects/longobject.c:3618: note: long_hash defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:1071:16 in
make: *** [Makefile:1691: Python/frozen_modules/getpath.h] Error 1

See for instance https://buildbot.python.org/#/builders/720/builds/1300.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

@picnixz
Copy link
Author

picnixz commented Aug 13, 2024

Closing in favor of the meta-issue python/cpython#111178

@picnixz
Copy link
Author

picnixz commented Aug 14, 2024

Because of the sheer amount of work to do (I just looked at what I needed to do, fixed 1-2 things and then gave up), I suggest adding a new build bot with -fsanitize=undefined -fno-sanitize=function -fsanitize-recover. That way, we could catch the other undefined behaviours that are not due to those casts. Currently, the build bot fails fast (and we only see 1 UB per build due to the -fno-sanitize-recover) but I think that most of the time, we won't have a lot of UBs (or else it's bad for us...). As such, having a build bot that builds entirely (with -fsanitize-recover) instead of fast-failing would help a lot in detecting the other cases.

Once this new build bot is green, we can focus on eliminating the UBs related to function pointers.

Note: see python/cpython#123004 (comment) for what was detected as a first pass. I suspect there are UBs that are not detected but that's for another day.

Originally posted by @picnixz in python/cpython#111178 (comment)

@picnixz
Copy link
Author

picnixz commented Aug 17, 2024

@pablogsal I was told that you were responsible for the USAN build bot. Could you consider
adding a build bot with the above configuration (namely, -fsanitize=undefined -fno-sanitize=function -fsanitize-recover) please?

@picnixz picnixz changed the title [CI/CD] Compilation issue for Arch Linux Usan 3.x/4532 Add Arch Linux Usan 3.x/ build bot with -fno-sanitize=function Aug 17, 2024
@erlend-aasland
Copy link

Should this issue be moved to the buildbot repo?

@picnixz
Copy link
Author

picnixz commented Aug 17, 2024

Oh yes, please. How can I do it easily? Should I just close this one and open a new one out there? (I forgot about the other repository...)

@picnixz
Copy link
Author

picnixz commented Aug 18, 2024

Should this issue be moved to the buildbot repo?

Is the repository in question: https://github.com/python/buildmaster-config? or is it another one?

@pablogsal
Copy link
Member

@pablogsal I was told that you were responsible for the USAN build bot. Could you consider

adding a build bot with the above configuration (namely, -fsanitize=undefined -fno-sanitize=function -fsanitize-recover) please?

Yeah absolutely! Do you want another bot with those settings or to just substitute the current one?

@pablogsal pablogsal transferred this issue from python/cpython Aug 18, 2024
@pablogsal
Copy link
Member

I have transferred the issue 👍

@picnixz
Copy link
Author

picnixz commented Aug 18, 2024

I would like to keep the current one because it's important to cover -fsanitize=undefined in general, so another one it would be. Thank you in advance (and for transfering the issue)! Alternatively, what you could do with the current one is to remove the -fno-sanitize-recover option so that the build does not early exit. I'm not sure whether you wanted an early exit or not in order to reduce the resources being taken by the way but by exiting early, we can only patch one error per build being triggered.

@encukou
Copy link
Member

encukou commented Aug 26, 2024

Another option would be to add an ignore list to Misc/ (next to the Valgrind suppression file), keep the currently known failures there, and turn it on for --with-undefined-behavior-sanitizer builds (including the buildbot).

I'm not sure if that supports filtering on function, though. Another option would be a runtime suppression list.

@pablogsal
Copy link
Member

Opened #519

@picnixz
Copy link
Author

picnixz commented Aug 27, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants