Describe the bug
play-services-mlkit-subject-segmentation:16.0.0-beta1 causes a fatal native crash (SIGSEGV in drishti_gl_runn) on Android 16 (API 36) when running inference. The crash is triggered by Android 16's Memory Tagging Extension (MTE) enforcement — the GPU delegate accesses memory through a pointer whose tag doesn't match the allocation tag, which is now a hard fault. The app process is killed instantly with no Java-level exception to catch.
To Reproduce
Add implementation("com.google.android.gms:play-services-mlkit-subject-segmentation:16.0.0-beta1") to your project
Create a segmenter:
val segmenter = SubjectSegmentation.getClient(
SubjectSegmenterOptions.Builder()
.enableForegroundBitmap()
.build()
)
Process any bitmap:
segmenter.process(InputImage.fromBitmap(bitmap, 0))
.addOnSuccessListener { ... }
Run on a device with Android 16 (API 36)
→ App crashes immediately. The crash occurs regardless of input image size (tested from 640×480 to 2560×1920).
If applicable, please include code snippet and sample input(image, video, text, etc)
Expected behavior
Segmentation completes successfully and returns a result, as it does on Android 14 and below.
Crash log
Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR)
fault addr 0xb40000726396a000 ← tagged pointer (MTE violation)
tid: drishti_gl_runn ← MLKit OpenGL GPU delegate thread
pid: com.example.app
ABI: arm64
The 0xb4... fault address confirms this is an MTE pointer tagging violation, not a null dereference or out-of-bounds access.
SDK Info:
- com.google.android.gms:play-services-mlkit-subject-segmentation:16.0.0-beta1
Note: this is the only published version of this library (last updated Nov 2023, never patched)
Smartphone:
- Device: Redmi (malachite_global)
- OS: Android 16 (API 36), build BP2A.250605.031.A3
Development Environment:
Android Studio Meerkat
AGP 9.0.0, Kotlin 2.3.10
Target SDK: 36, Min SDK: 26