Crash using `AssetLoader.createInstancedAsset()` on devices with Qualcomm Adreno 830 GPU
- Dominant language
- C++
- Stars
- 20.5k
- Forks
- 2.3k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 74
Description
**Describe the bug**
`AssetLoader.createInstancedAsset()` with 100 instances causes a SIGSEGV (null pointer dereference at address `0x0`) in `FEngine::loop` on devices with Qualcomm Adreno 830 GPU. The crash occurs during asynchronous resource processing on the render thread, approximately 60-120ms after `ResourceLoader.loadResources()` returns. The crash is 100% reproducible and occurs on both OpenGL ES and Vulkan backends.
No entities are added to any Filament `Scene`, no `Renderer.beginFrame()` or `render()` calls are made, and no frame is ever rendered before the crash. The crash is triggered purely by `createInstancedAsset` + `loadResources`.
Non-instanced loading of the same GLB model via `AssetLoader.createAsset()` works perfectly on the same Adreno 830 device. The same instanced code path works correctly on Pixel 9 Pro (Mali) and Galaxy Tab S11.
**To Reproduce**
1. Create a Filament `Engine` (crashes on both Vulkan and OpenGL ES backends)
2. Create an `AssetLoader` with `UbershaderProvider` and a `ResourceLoader`
3. Load any valid `.glb` file using `AssetLoader.createInstancedAsset()` with 100 instances
4. Call `ResourceLoader.loadResources()` on the returned asset
5. CRASH: ~60-120ms later, `FEngine::loop` hits SIGSEGV at address `0x0`
Note: no `Scene`, `View`, `Camera`, `SwapChain`, or `Renderer` is created. No `addEntity()`, `beginFrame()`, `render()`, or `endFrame()` is ever called. The crash is triggered solely by `createInstancedAsset()` + `loadResources()`.
Minimal reproduction code (Kotlin/Android):
```kotlin
import com.google.android.filament.Engine
import com.google.android.filament.EntityManager
import com.google.android.filament.gltfio.AssetLoader
import com.google.android.filament.gltfio.FilamentInstance
import com.google.android.filament.gltfio.ResourceLoader
import com.google.android.filament.gltfio.UbershaderProvider
// 1. Create engine and gltfio components
val engine = Engine.create() // crashes on both default (Vulkan) and Engine.Backend.OPENGL
val materialProvider = UbershaderProvider(engine)
val assetLoader = AssetLoader(engine, materialProvider, EntityManager.get())
val resourceLoader = ResourceLoader(engine)
// 2. Load a GLB model as an instanced asset with 100 instances
val glbData: ByteBuffer = // ... read any valid .glb file from Android assets
val instances = arrayOfNulls(100)
val asset = assetLoader.createInstancedAsset(glbData, instances)
// 3. Load GPU resources — this is the ONLY call needed to trigger the crash.
// No Scene, no addEntity, no View, no Camera, no Renderer calls.
resourceLoader.loadResources(asset!!)
asset.releaseSourceData()
// 4. CRASH: ~60-120ms later, FEngine::loop hits SIGSEGV at address 0x0
// The crash occurs on the render thread while processing loadResources commands.
// No beginFrame(), render(), or endFrame() is ever called.
```
The desktop sample `gltf_instances` (in `samples/gltf_instances.cpp`) exercises the same `createInstancedAsset` code path with dynamic instance creation up to 100 instances. However, reproducing on Android requires the Adreno 830 GPU. The existing Android `sample-gltf-viewer` does not use instancing — it would need `createAsset()` replaced with `createInstancedAsset()` using ~100 instances to trigger the crash.
**Expected behavior**
`createInstancedAsset()` with 100 instances followed by `loadResources()` should complete without crashing, as it does on other GPUs (Pixel 9 Pro with Mali, Galaxy Tab S11). Non-instanced loading of the same model via `createAsset()` works correctly on the same Adreno 830 device.
**Screenshots**
N/A
**Logs**
Crash signal:
```
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
in tid (FEngine::loop), pid (.kollie.cmpdemo)
#05 pc 000000000019d250 libfilament-jni.so (offset 0x560c000)
(BuildId: f692ef1b6512e1253723ab29e72d6491c2a31329)
```
- Fault address: `0x0` — null pointer dereference
- Thread: `FEngine::loop` (Filament render/job thread)
- Crash PC: `0x19d250` in `libfilament-jni.so` — consistent across all reproductions
- The crash address is identical across OpenGL and Vulkan backends, and across Filament 1.68.3 and 1.70.0
Active Filament workarounds on this device (from Filament log output at startup):
```
[Qualcomm], [Adreno (TM) 830], [OpenGL ES 3.2 V@0800.40.1]
Feature level: 2
Active workarounds:
dont_use_timer_query
disable_blit_into_texture_array
split_easu
allow_read_only_ancillary_feedback_loop
enable_initialize_non_used_uniform_array
```
**Desktop (please complete the following information):**
N/A (Android-only reproduction)
**Smartphone (please complete the following information):**
- Device: Samsung Galaxy S25 Ultra (Snapdragon 8 Gen 3) — **CRASH**
- Device: Samsung Galaxy Tab S11 — Works
- Device: Google Pixel 9 Pro — Works
- OS: Android 16 (API 36)
**Additional context**
- Filament versions tested: 1.68.3 and 1.70.0 (same crash on both)
- GPU: Qualcomm Adreno (TM) 830 (Snapdragon 8 Gen 3)
- GPU driver: v0800.40.1 (build 07/21/25, shader compiler E031.47.18.36)
- Backends tested: OpenGL ES 3.2, Vulkan 1.1
- Architecture: arm64-v8a
What we ruled out:
1. **Not backend-specific**: Crashes identically on both OpenGL ES and Vulkan
2. **Not version-specific**: Crashes on both Filament 1.68.3 and 1.70.0
3. **Not a rendering issue**: No `Scene`, no `addEntity`, no `beginFrame`/`render` calls — crash occurs before any frame is rendered
4. **Not a resource cleanup race**: Crashes on a fresh cold start with a single `createInstancedAsset` call
5. **Not model-specific**: Same model works with non-instanced `createAsset()` on the same device
6. **Not a scene transition issue**: Crashes on the very first (and only) load — no prior scene exists
Contributor guide
Assessment
This issue has not been assessed yet.