The Spectrum Dispatch News

technology

Android 17 Bug Forces Developers to Disassemble Libraries to Report Issues

Wide character string functions fail with non-ASCII text, but AOSP source code remains unavailable months after release.

Android 17 Bug Forces Developers to Disassemble Libraries to Report Issues

A bug in Android 17’s C standard library functions wcscspn() and wcspbrk() causes them to incorrectly halt when encountering characters above U+0100 (non-Latin characters including emoji and CJK), according to a GitHub issue filed with the Android NDK team.

Android 17 Bug Forces Developers to Disassemble Libraries to Report Issues

The functions are supposed to scan strings for a set of delimiter characters, continuing past any characters outside that set. However, when the delimiter set contains only ASCII characters (all below U+0100), the implementation incorrectly stops at the first non-ASCII character and reports it as a match, even though it is not in the set.

According to the bug report, the issue manifests in real applications. Visual Pinball on Android, which uses Wine’s VBScript engine, stopped loading any script containing an emoji in a comment after the September update. FileSystem.MoveFolder treated any path with non-ASCII characters as containing wildcards. The developers worked around the issue by replacing the library calls with custom loops.

The root cause, visible through disassembly of the shipped libc.so on affected Pixel devices, involves an optimization path that builds a 256-byte lookup table for ASCII characters. The code correctly falls back to character-by-character comparison when the delimiter set contains non-ASCII characters, but incorrectly halts entirely when it encounters non-ASCII input with an ASCII-only delimiter set.

NDK team member enh-google acknowledged the bug report on October 12, 2026, confirming it remained unfixed in the latest code. However, a significant complication emerged: the public Android 17 release sources (android-17.0.0_r1 from June 2026) build these functions from external/llvm-libc and are correct, but the September builds use different code that was introduced after the June release.

Developers attempting to report or understand the bug faced a critical barrier—the actual source code for the Android 17 version running on Pixel phones remained unavailable for months. As one commenter noted, the android-latest-release branch was described as “still too old” to contain April changes, making it impossible to examine the buggy source code publicly. This forced reporters to reverse-engineer the bug through disassembly of the shipped binary, a practice typically unnecessary when source code is available.

Key facts

  • wcscspn() and wcspbrk() in Android 17 incorrectly treat all characters >= U+0100 as matches when the delimiter set contains only ASCII characters
  • The bug breaks real applications including Visual Pinball and affects any code scanning wide strings for ASCII delimiters
  • Developers had to disassemble Android’s libc.so binary to identify and report the bug because AOSP source code for the affected build remained unpublished months after release
  • The regression was introduced between Android 17’s June and September releases, but reverse engineering was needed because the September source code was not publicly available

Sources

← All posts