-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
UBSan misaligned load errors in gethost_common()
, mkgrent()
#104432
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
Labels
3.11
only security fixes
3.12
only security fixes
extension-modules
C modules in the Modules dir
OS-mac
type-bug
An unexpected behavior, bug, or error
Comments
chrstphrchvz
added a commit
to chrstphrchvz/cpython
that referenced
this issue
May 12, 2023
gpshead
pushed a commit
that referenced
this issue
Jul 27, 2023
This was referenced Jul 27, 2023
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jul 27, 2023
…04433) Fix potential unaligned memory access on C APIs involving returned sequences of `char *` pointers within the :mod:`grp` and :mod:`socket` modules. These were revealed using a ``-fsaniziter=alignment`` build on ARM macOS. (cherry picked from commit f01e4ce) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jul 27, 2023
…04433) Fix potential unaligned memory access on C APIs involving returned sequences of `char *` pointers within the :mod:`grp` and :mod:`socket` modules. These were revealed using a ``-fsaniziter=alignment`` build on ARM macOS. (cherry picked from commit f01e4ce) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
gpshead
pushed a commit
that referenced
this issue
Jul 27, 2023
#107355) gh-104432: Use `memcpy()` to avoid misaligned loads (GH-104433) Fix potential unaligned memory access on C APIs involving returned sequences of `char *` pointers within the :mod:`grp` and :mod:`socket` modules. These were revealed using a ``-fsaniziter=alignment`` build on ARM macOS. (cherry picked from commit f01e4ce) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
thanks! |
gpshead
pushed a commit
that referenced
this issue
Jul 28, 2023
#107356) gh-104432: Use `memcpy()` to avoid misaligned loads (GH-104433) Fix potential unaligned memory access on C APIs involving returned sequences of `char *` pointers within the :mod:`grp` and :mod:`socket` modules. These were revealed using a ``-fsaniziter=alignment`` build on ARM macOS. (cherry picked from commit f01e4ce) Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3.11
only security fixes
3.12
only security fixes
extension-modules
C modules in the Modules dir
OS-mac
type-bug
An unexpected behavior, bug, or error
Uh oh!
There was an error while loading. Please reload this page.
test.test_asyncio.test_events.KqueueEventLoopTests.test_create_connection triggers
-fsanitize=alignment
errors on macOS (i.e. Darwin):I believe this issue is also present in this line (but I am not aware if any tests cover it):
cpython/Modules/socketmodule.c
Line 5834 in ac66cc1
Likewise in test.test_grp.GroupDatabaseTestCase.test_errors:
To be clear, these tests pass, and the misaligned pointers are produced by the OS and not Python. The misaligned pointers appear to be a known issue, presumably one which Apple may never resolve (given these are functions inherited from BSD, and newer functions like
getaddrinfo()
are preferred according to man pages). The workaround is to usememcpy()
(see e.g. php/php-src@26ac6cb).Linked PRs
memcpy()
to avoid misaligned loads #104433memcpy()
to avoid misaligned loads (GH-104433) #107355memcpy()
to avoid misaligned loads (GH-104433) #107356The text was updated successfully, but these errors were encountered: