classification
Title: unaligned memory access in the _sha3 extension
Type: crash Stage: resolved
Components: Extension Modules Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: christian.heimes, doko, gregory.p.smith, miss-islington
Priority: high Keywords: patch

Created on 2019-04-03 05:41 by doko, last changed 2021-05-06 06:57 by christian.heimes. This issue is now closed.

Files
File name Uploaded Description Edit
arm-alignment.diff doko, 2019-04-03 05:41 patch
Pull Requests
URL Status Linked Edit
PR 25927 merged gregory.p.smith, 2021-05-05 18:52
PR 25928 merged miss-islington, 2021-05-05 20:55
PR 25930 merged miss-islington, 2021-05-05 21:41
Messages (4)
msg339379 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2019-04-03 05:41
This was seen when running an armhf binary on a 64bit kernel. The problem is that the implementation uses unaligned memory accesses, and even is well aware of that. The module allows misaligned memory accesses by default. The NO_MISALIGNED_ACCESSES macro is never defined.  Now you can define it only on architectures where unaligned memory accesses are not allowed (ARM32 on 64bit kernels), or where there are performance penalties (AArch64), or just don't try to outsmart modern compilers and always define this macro.

The attached patch only fixes the issue on ARM32 and AArch64, however the safe fix should be to always define the macro.
msg393032 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2021-05-05 18:32
that patch looks fine, i'll turn it into a PR.
msg393047 - (view) Author: miss-islington (miss-islington) Date: 2021-05-05 22:05
New changeset 3b2a45ff95a68acc8276b37678c98740a232f6d4 by Miss Islington (bot) in branch '3.10':
bpo-36515: Disable unaligned memory access in _sha3 on ARM (GH-25927)
https://github.com/python/cpython/commit/3b2a45ff95a68acc8276b37678c98740a232f6d4
msg393063 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-05-06 06:56
New changeset ce47addfb6f176fad053431b537b77a5f170765e by Miss Islington (bot) in branch '3.9':
[3.9] bpo-36515: Disable unaligned memory access in _sha3 on ARM (GH-25927) (GH-25928)
https://github.com/python/cpython/commit/ce47addfb6f176fad053431b537b77a5f170765e
History
Date User Action Args
2021-05-06 06:57:39christian.heimessetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: - Python 3.6, Python 3.7, Python 3.8
2021-05-06 06:56:02christian.heimessetmessages: + msg393063
2021-05-05 22:05:29miss-islingtonsetmessages: + msg393047
2021-05-05 21:41:17miss-islingtonsetpull_requests: + pull_request24597
2021-05-05 20:55:46miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request24595
2021-05-05 18:53:28gregory.p.smithlinkissue44043 dependencies
2021-05-05 18:52:07gregory.p.smithsetstage: patch review
pull_requests: + pull_request24594
2021-05-05 18:32:59gregory.p.smithsetassignee: christian.heimes -> gregory.p.smith

messages: + msg393032
nosy: + gregory.p.smith
2021-05-05 18:30:25gregory.p.smithsetassignee: christian.heimes
versions: + Python 3.9, Python 3.10, Python 3.11
2019-04-03 07:14:44dokolinkissue36445 superseder
2019-04-03 05:41:19dokocreate