Skip to content

gh-133261: Use __builtin_frame_address() on GCC 9 and older #133269

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

Merged
merged 1 commit into from
May 1, 2025

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 1, 2025

GCC 9 and older don't have __has_builtin(), but have __builtin_frame_address() function.

GCC 9 and older don't have __has_builtin(), but have
__builtin_frame_address() function.
@vstinner
Copy link
Member Author

vstinner commented May 1, 2025

Without this change, test_frame crash randomly (ex: at the 3rd attempt).

With this change, test_frame no longer crash. I ran the test in a loop using ./python -m test test_frame -F and interrupted the test after 54 successful iterations.

@ambv
Copy link
Contributor

ambv commented May 1, 2025

Unsurprisingly, on Windows 11 with a different compiler and this PR applied, running -m test test_frame -F is still crashing with a stack overflow. That will need a different fix.

@vstinner vstinner merged commit d10bd81 into python:main May 1, 2025
45 checks passed
@vstinner vstinner deleted the builtin_frame_address branch May 1, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants