Skip to content

Broken stack size detection on Android #159320

Open

Description

@Yhg1s

Bug report

As part of investigating a test failure on #159289 on Android, I noticed the stack size detection with pthread_getatttr_np is (seemingly unintentionally) disabled on Android, because it's Linux and not glibc and so Python/ceval.c:145 assumes it's musl. Investigating the claim that musl's pthread_getattr_np doesn't work right (added in #134336) a little further it seems that it's only a problem for the main thread, not for subsequent threads. We can probably fix the code to work right on musl, although it sure would be nice if we could reliably detect musl, given that it's functionally different in more than a few places.

I have a small PR fixing the test for Android, and I'm working on a bigger PR that tries to improve pthread_getattr_np handling on musl (and other platforms that give incorrect results).

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. self-assigned this
    on Oct 13, 2026
  2. added
    type-bugAn unexpected behavior, bug, or error
    on Oct 13, 2026
  3. added 3 commits that reference this issue on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

OS-androidinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions