android: stdlib stack overflow handlers are not installed
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
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:
- Add the
getauxvaldeclaration 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. - Add
androidto the registration block - Remove the
ignore-androidI'm about to add fromtests/ui/abi/stack-probes.rsandtests/ui/abi/stack-probes-lto.rsand check that they still work.
cc @chriswailes Perhaps you'd like to take this one?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with library/std/src/sys/pal/unix/stack_overflow.rs and the 32-bit Android module in libc, then inspect tests/ui/abi/stack-probes.rs and stack-probes-lto.rs. Verify the Android stack-overflow registration and getauxval availability, remove the Android ignores, and run both tests to confirm the handlers work on Android targets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, rust
- Domain
- operating-systems, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100