Conversation

picnixz
  • 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.
@picnixzpicnixz requested a review from vstinner May 16, 2025 09:03
@picnixz

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

Choose a reason for hiding this comment

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

LGTM

@vstinner

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.

@picnixzpicnixz merged commit 0a160bf into python:main May 18, 2025
42 checks passed
@picnixzpicnixz deleted the fix/ubsan/faulthandler-133157 branch May 18, 2025 08:16
Sign up for free to join this conversation on . Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.