FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Skip GNU backtrace test on Arm 32-bit by diegorusso · Pull Request #149493 · python/cpython · GitHub

Repository navigation

Skip GNU backtrace test on Arm 32-bit - #149493

Merged
diegorusso merged 5 commits into
python:mainfrom
diegorusso:backtrace-arm
May 8, 2026
Merged

diegorusso merged 5 commits into
python:mainfrom
diegorusso:backtrace-arm

Conversation

diegorusso commented May 7, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor

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:

  .ARM.exidx contains 1 entry:
    _start: cantunwind

With -funwind-tables, GCC emits the ARM EHABI runtime unwind tables needed by backtrace().
GCC documents -funwind-tables as 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.

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.

encukou commented May 7, 2026

Copy link
Copy Markdown
Member

!buildbot ARM Raspbian

Copy link
Copy Markdown

🤖 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: ARM Raspbian

The builders matched are:

  • ARM Raspbian PR

Copy link
Copy Markdown
Contributor Author

still failing...

Comment thread Lib/test/test_frame_pointer_unwind.py Outdated


def _gnu_backtrace_requires_unwind_tables(machine):
if not (sys.maxsize < 2**32 and machine.startswith("arm")):

encukou May 7, 2026 •
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

AFAIK it's an aarch64 machine, with a 32-bit Python build?

Suggested change
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 :/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

mmm I don't think this is the right approach. We need to base the condition about the build of Python

Copy link
Copy Markdown
Contributor Author

!buildbot ARM Raspbian

Copy link
Copy Markdown

🤖 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: ARM Raspbian

The builders matched are:

  • ARM Raspbian PR

Comment thread Lib/test/test_frame_pointer_unwind.py Outdated
Comment on lines +118 to +130
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That's a lot of untested logic.
Should we skip the test for any 32-bit Arm?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Contributor Author

!buildbot ARM Raspbian

Copy link
Copy Markdown

🤖 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: ARM Raspbian

The builders matched are:

  • ARM Raspbian PR

Copy link
Copy Markdown
Contributor Author

!buildbot ARM Raspbian

Copy link
Copy Markdown
Member

Updating to fix some errors we introduced on the main branch.

Copy link
Copy Markdown
Contributor Author

!buildbot ARM Raspbian

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @diegorusso for commit 42177ce 🤖

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: ARM Raspbian

The builders matched are:

  • ARM Raspbian PR

diegorusso requested a review from markshannon May 8, 2026 10:36

markshannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good, and much simpler now

diegorusso changed the title Skip GNU backtrace test on Arm 32-bit without unwind tables Skip GNU backtrace test on Arm 32-bit May 8, 2026
diegorusso merged commit 2a8cece into python:main May 8, 2026
54 checks passed
diegorusso added the needs backport to 3.15 bugs and security fixes label May 8, 2026

Copy link
Copy Markdown

Thanks @diegorusso for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

bedevere-app Bot commented May 8, 2026

Copy link
Copy Markdown

GH-149562 is a backport of this pull request to the 3.15 branch.

bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label May 8, 2026
diegorusso deleted the backtrace-arm branch May 8, 2026 13:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip issue skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL