Skip to content

gh-133157: remove use of _Py_NO_SANITIZE_UNDEFINED in faulthandler #134047

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

Merged
merged 3 commits into from
May 18, 2025

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented May 15, 2025

  • remove _read_null() as it's a tricky one (and the compiler didn't seem to complain)
  • instead of using 1/0 arithmetic, we explicitly raise SIGFPE

- reading from NULL is no more an undefined behavior for C11
- instead of using 1/0 arithmetic, we explicitly raise SIGFPE
picnixz added 2 commits May 15, 2025 17:30
Reading from NULL is an undefined behavior and `faulthandler`
should not check for low-level C about undefined behaviors.
@picnixz picnixz requested a review from vstinner May 16, 2025 09:03
@picnixz
Copy link
Member Author

picnixz commented May 16, 2025

Should I actually add a NEWS entry? the function was not documented but it had a docstring.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vstinner
Copy link
Member

Should I actually add a NEWS entry? the function was not documented but it had a docstring.

It doesn't need a NEWS entry since it's a private function written for test_faulthandler.

@picnixz picnixz merged commit 0a160bf into python:main May 18, 2025
42 checks passed
@picnixz picnixz deleted the fix/ubsan/faulthandler-133157 branch May 18, 2025 08:16
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.

2 participants