Closed
Description
Bug report
Bug description:
If we build cpython 3.13 for Linux/ARMv5 using -march=armv5te
and then run inside a qemu with the versatilepb
machine (which uses a ARM926EJ-S processor) then python crashes with "Illegal Instruction". Specifically, mrc
is used in a few places to get the thread ID, but this not possible in cores lower than ARMv6K.
Users of mrc
:
- https://github.com/python/cpython/blob/main/Include/object.h#L195
- https://github.com/python/cpython/blob/main/Include/internal/mimalloc/mimalloc/prim.h#L172
- https://github.com/python/cpython/blob/main/Include/internal/mimalloc/mimalloc/prim.h#L199
I suspect the best way of implemented the required check would be:
#if defined(__arm__) && __ARM_ARCH >= 6 && !defined(__ARM_ARCH_6__)
That is, if Arm and if the architecture level is 6 or great and if this is not bare v6 (so v6K/v6Z are included).
Or a blunter but simpler hammer on the grounds that v5/v6 is pretty niche these days could be:
#if defined(__arm__) && __ARM_ARCH >= 7
CPython versions tested on:
3.13
Operating systems tested on:
Linux