Skip to content

android: stdlib stack overflow handlers are not installed #124823

Open
@maurer

Description

When updating the CI to newer NDK/APIs, I enabled aarch64-linux-android testing, and found that tests/ui/abi/stack-probes.rs was failing. Luckily, the stack probes themselves are working (the expected SIGSEGV is being triggered), but as the signal handler is not installed, the test fails and the user wouldn't receive a helpful error + backtrace in the real world.

The registration is currently in an odd state where the implementation is enabled for Linux but not Android, and yet contains Android-specific cfgs inside.

Enabling it (by adding "android" to both the mod cfg blocks) works on aarch64, but on arm, it fails because getauxval is missing from libc.

The route to fixing this:

  1. Add the getauxval declaration to libc android 32-bit (it's already in 64-bit). The original argument for not including it is that it was added in Android API 18. Since we're bumping to 21+ as the minimum API, that should not be an issue.
  2. Add android to the registration block
  3. Remove the ignore-android I'm about to add from tests/ui/abi/stack-probes.rs and tests/ui/abi/stack-probes-lto.rs and check that they still work.

cc @chriswailes Perhaps you'd like to take this one?

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-androidOperating system: AndroidT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions