NDK 27 arm64 Maps and bundled libc++ have non-16 KB GNU_RELRO segment ends
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 44/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- mobile, performance
Research direction
The issue identifies the affected arm64 artifacts as libmapbox-maps.so in android-core-ndk27 and libc++_shared.so in common-ndk27. Start by inspecting their GNU_RELRO program headers with the Android NDK llvm-readelf -lW command shown in the issue and compare the segment ends with Android's 16 KB alignment guidance. Done means the affected artifacts have aligned GNU_RELRO ends or the project documents why their layout is safe on native 16 KB devices.
Written by the indexing model from the issue text.
Description
Environment
- Android OS version: Android 16 / API 36 for the bounded emulator result below; the static artifact check is OS-independent.
- Devices affected: arm64-v8a artifacts intended for 16 KB page-size devices; no physical-device failure established.
- Maps SDK Version: 11.33.0, then 11.32.2 (
-ndk27; Common 24.33.0, then 24.32.2).
Observed behavior and steps to reproduce
The latest stable Maps 11.33.0 artifacts have nonzero GNU_RELRO end remainders for libmapbox-maps.so and libc++_shared.so, despite every LOAD meeting 16 KB alignment. common-ndk27 ships libc++_shared.so; android-core-ndk27 ships libmapbox-maps.so.
- Download each official AAR linked below, for example
curl -fLO '<AAR URL>'. - Extract the arm64 libraries:
unzip '<artifact>.aar' 'jni/arm64-v8a/*.so' -d extracted(use a separate destination for each AAR). - Run the Android NDK tool
llvm-readelf -lW extracted/jni/arm64-v8a/<library>.sofor each library. - Check every LOAD: p_align is at least
0x4000, is a power of two, and(VirtAddr - Offset) % p_align == 0; all pass here. For GNU_RELRO, calculate(VirtAddr + MemSiz) % 0x4000; the nonzero values below reproduce the defect against the documented end-alignment check.
| Library (arm64-v8a) | AAR version | Every LOAD p_align | GNU_RELRO VirtAddr + MemSiz = end | end % 0x4000 |
|---|---|---|---|---|
| libc++_shared.so | 24.33.0 | 0x4000, 0x4000, 0x4000, 0x4000 | 0x1392f0 + 0x9d10 = 0x143000 | 0x3000 |
| libmapbox-common.so | 24.33.0 | 0x4000, 0x4000, 0x4000 | 0x67c720 + 0x1f8e0 = 0x69c000 | 0x0 |
| libmapbox-maps.so | 11.33.0 | 0x4000, 0x4000, 0x4000 | 0x11d8f60 + 0x5a0a0 = 0x1233000 | 0x3000 |
| libc++_shared.so | 24.32.2 | 0x4000, 0x4000, 0x4000, 0x4000 | 0x1392f0 + 0x9d10 = 0x143000 | 0x3000 |
| libmapbox-common.so | 24.32.2 | 0x4000, 0x4000, 0x4000 | 0x67ebe0 + 0x20420 = 0x69f000 | 0x3000 |
| libmapbox-maps.so | 11.32.2 | 0x4000, 0x4000, 0x4000 | 0x11d2950 + 0x5a6b0 = 0x122d000 | 0x1000 |
Expected behavior
The GNU_RELRO segment end is aligned to 16 KB, so (VirtAddr + MemSiz) % 0x4000 == 0, per Android's RELRO guidance, or Mapbox documents why this layout is safe on native 16 KB devices.
Notes / preliminary analysis
libmapbox-common.so now passes the end-alignment formula in Common 24.33.0 (0x0 remainder); it is included above as a passing comparison, not a current defect. Its older Common 24.32.2 artifact still has a nonzero remainder. No separate Common issue is proposed; upgrading resolves that library's static finding.
In a prior bounded Android 16 / API 36 arm64 emulator run with 16 KB pages and linker/package compatibility mode disabled, Maps 11.32.0 / Common 24.32.0 -ndk27 rendered online and offline fixture maps: no crash observed. That result does not establish safety, physical-device compatibility, or runtime behavior of 11.33.0/11.32.2; those versions were checked statically only.
Additional links and references
- common-ndk27-24.33.0.aar — SHA-256
93f9c60d8edc0f5bba36c2d13f5920200c04cdc64fc241d300a899e1ce0b1665. - android-core-ndk27-11.33.0.aar — SHA-256
474bc25126f260ba79b091485ff7ba5806ec6867be7734a69e2a31e71b0107e0. - common-ndk27-24.32.2.aar — SHA-256
424b899735e97b708bf990189880216dc62263c82634b9bb9ac420b2367348d6. - android-core-ndk27-11.32.2.aar — SHA-256
cdb7a28e14170bb870de96c199b8bcec4a55d17702d0842f7294416bfece4678.
Android guide: https://developer.android.com/guide/practices/page-sizes#relro-flag
- Dominant language
- Kotlin
- Stars
- 579
- Forks
- 164
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from mapbox/mapbox-maps-android
-
bug :beetle:
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
mapbox/mapbox-maps-android#2727 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
mapbox/mapbox-maps-android#2738 ·
-
bug :beetle:
Difficulty 4/5 3-5 days Newbie friendliness 38/100
mapbox/mapbox-maps-android#2736 ·
-
bug :beetle:
Difficulty 5/5 Over a week Newbie friendliness 22/100
mapbox/mapbox-maps-android#2734 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
mapbox/mapbox-maps-android#2733 ·
All issues in mapbox/mapbox-maps-android
Similar issues
-
bug iOS UI
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
devsoc-unsw/freerooms-mobile#278 ·
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
home-assistant/android#7690 ·
Maintainers usually reply within 1 day
-
staticAssetsPath follows symlinks outside the directory on WindowsPossibly taken @ybelMekk claimed this today. Openbug security findings
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
navikt/mock-oauth2-server#1132 ·
Maintainers usually reply within 1 day
-
performance solver
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day