Skip to content

gh-111178: fix UBSan failures in Modules/selectmodule.c #129792

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 13 commits into from
Feb 24, 2025

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Feb 7, 2025

This PR fixes the UBSan failures and addresses some minor cosmetic changes. PEP-7 changes were not applied since they could scramble the diff but other semantic changes affecting the signature of touched functions may have been done.

@picnixz picnixz marked this pull request as ready for review February 7, 2025 18:09
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

@picnixz
Copy link
Member Author

picnixz commented Feb 23, 2025

@vstinner I've observed that _select_exec was not declared static so I declared it static as well. I think it was an omission of not having it static. The commit message will be:

Fix some UBSan failures for `pollObject`, `devpollObject`, `pyEpoll_Object` as well as
for `kqueue_event_Object`, `kqueue_queue_Object` and `kqueue_tracking_after_fork`.

We also perform some cleanup by suppressing unused return values and renaming the
unused parameter in `METH_NOARGS` and getter/setter methods to `dummy` and `closure`
respectively for semantic purposes. We also explicitly declare `_select_exec` as a
`static` function.

@picnixz picnixz requested a review from vstinner February 23, 2025 10:08
@encukou encukou merged commit 73bbaf3 into python:main Feb 24, 2025
41 checks passed
@picnixz picnixz deleted the fix/ubsan/select-111178 branch February 24, 2025 12:39
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
…onGH-129792)

Fix some UBSan failures for `pollObject`, `devpollObject`, `pyEpoll_Object` as well as
for `kqueue_event_Object`, `kqueue_queue_Object` and `kqueue_tracking_after_fork`.

Suppress unused return values.

Rename the unused parameter in `METH_NOARGS` and getter/setter methods to
`dummy` and `closure` respectively for semantic purposes.

Explicitly declare `_select_exec` as a `static` function.
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