Skip GNU backtrace test on Arm 32-bit without unwind tables#149493
Skip GNU backtrace test on Arm 32-bit without unwind tables#149493diegorusso wants to merge 4 commits intopython:mainfrom
Conversation
backtrace() on 32-bit ARM EABI depends on runtime unwind tables emitted as .ARM.exidx/.ARM.extab. Without -funwind-tables, glibc can return an empty stack even though GDB can still unwind using debug-only .debug_frame data. Only skip the GNU backtrace unwind test on Arm 32-bit builds that lack -funwind-tables, instead of skipping all Arm 32-bit builds.
|
!buildbot ARM Raspbian |
|
🤖 New build scheduled with the buildbot fleet by @encukou for commit 3358e2d 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F149493%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
|
still failing... |
|
|
||
|
|
||
| def _gnu_backtrace_requires_unwind_tables(machine): | ||
| if not (sys.maxsize < 2**32 and machine.startswith("arm")): |
There was a problem hiding this comment.
AFAIK it's an aarch64 machine, with a 32-bit Python build?
| if not (sys.maxsize < 2**32 and machine.startswith("arm")): | |
| if not (sys.maxsize < 2**32 and machine.startswith(("arm", "aarch"))): |
But we're deep into overfitting to Buildbot workers here :/
There was a problem hiding this comment.
mmm I don't think this is the right approach. We need to base the condition about the build of Python
|
!buildbot ARM Raspbian |
|
🤖 New build scheduled with the buildbot fleet by @diegorusso for commit cb52a24 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F149493%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
| for option in options: | ||
| if option == "-funwind-tables": | ||
| unwind_tables = True | ||
| elif option == "-fno-unwind-tables": | ||
| unwind_tables = False | ||
| elif option == "-fasynchronous-unwind-tables": | ||
| asynchronous_unwind_tables = True | ||
| elif option == "-fno-asynchronous-unwind-tables": | ||
| asynchronous_unwind_tables = False | ||
| elif option == "-fexceptions": | ||
| exceptions = True | ||
| elif option == "-fno-exceptions": | ||
| exceptions = False |
There was a problem hiding this comment.
That's a lot of untested logic.
Should we skip the test for any 32-bit Arm?
There was a problem hiding this comment.
I tend to agree with you. On Arm 32bit you can have unwind data with any of these flags: -funwind-tables, -fasynchronous-unwind-tables, -fexceptions
GNU backtrace() can return an empty stack on 32-bit Arm when the build lacks suitable runtime unwind tables. Rather than trying to infer the effective unwind-table compiler flags in the test, skip the GNU backtrace tests on all 32-bit Arm builds.
|
!buildbot ARM Raspbian |
|
🤖 New build scheduled with the buildbot fleet by @diegorusso for commit 61015e1 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F149493%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
|
!buildbot ARM Raspbian |
backtrace() and GDB use different unwinding paths.
On AArch64, runtime unwinding normally uses DWARF CFI in .eh_frame / .eh_frame_hdr.
On 32-bit ARM EABI, the runtime unwind format is .ARM.exidx / .ARM.extab, as specified by the Arm EHABI (https://github.com/ARM-software/abi-aa/blob/main/ehabi32/ehabi32.rst#the-object-producer-interface)
GDB can still unwind the 32-bit ARM binary because it can read debugger-only DWARF CFI from .debug_frame, while glibc backtrace() runs inside the process and needs runtime unwind metadata.
Without -funwind-tables, the 32-bit ARM build has effectively empty runtime unwind metadata:
With
-funwind-tables, GCC emits the ARM EHABI runtime unwind tables needed by backtrace().GCC documents
-funwind-tablesas generating the needed static unwind data without otherwise changing generated code.This PR skips the GNU backtrace unwind test only on 32-bit Arm builds that lack -funwind-tables, instead of skipping all 32-bit Arm builds.