Repository navigation
Description
Current behavior 🐛
An Android app that draws with WebGPU crashes a few seconds after start on the Android 16 (API 36) emulator: a segmentation fault in wgpu's wgpuQueueWriteBuffer, on Uno's WebGPU render thread.
[webgpu] init device — adapter='SwiftShader Device (LLVM 10.0.0)' backend=Vulkan type=CPU colorFormat=BGRA8Unorm
F libc : Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x7b371787e160 in tid 3645 (UnoWebGpuRender), pid 3238 (ive.uno.ui.demo)
F DEBUG : backtrace:
F DEBUG : #00 pc 000000000008fa47 /apex/com.android.runtime/lib64/bionic/libc.so (memmove+87)
F DEBUG : #01 pc 000000000031be73 .../lib/x86_64/libwgpu_native.so (wgpu_core::device::queue::Queue::write_buffer+723)
F DEBUG : #02 pc 0000000000432d44 .../lib/x86_64/libwgpu_native.so (wgpu_core::...::Global::queue_write_buffer+180)
F DEBUG : #03 pc 00000000002824e0 .../lib/x86_64/libwgpu_native.so (wgpuQueueWriteBuffer+80)
F DEBUG : #04 pc 00000000007e3386 <anonymous:52002000>
SEGV_ACCERR inside memmove: the write into the buffer's mapped memory is refused.
The same APK on an Android 15 (API 35) emulator, with the same SwiftShader adapter, starts, renders and passes the app's runtime tests. Uno's own Android WebGPU lane runs on API 34, so it doesn't cover API 35 or 36.
Expected behavior 🎯
The app renders with WebGPU on Android 16 as it does on Android 15.
How to reproduce it (as minimally and precisely as possible) 🔬
-
Build an Android app with
<UnoFeatures>Skia;WebGpu</UnoFeatures>that registers the WebGPU backend inCreateHost():UnoPlatformHostBuilder.Create() .App(() => new App()) .UseAndroid() .GraphicsBackend(WebGpuBackend.CreateGraphicsProvider()) .GeometryFactory(ManagedBackend.CreateGeometryFactory()) .Build();
-
Start an API 36 emulator with software Vulkan:
system-images;android-36;google_apis;x86_64,emulator -avd <avd> -gpu swiftshader_indirect -no-window. -
Install and start the app: it crashes within a few seconds, with the backtrace above.
Seen with the Uno Gallery's WebGPU canary build (Release), twice out of two runs on API 36; zero crashes on API 35 (system-images;android-35;google_apis;x86_64, same emulator, same flags). The emulator reports a 4 KB page size on both, so 16 KB pages aren't involved.
Workaround 🛠️
None found in the app. The Uno Gallery's CI emulator is API 34, so its WebGPU canary isn't blocked.
Affected platforms 📱💻🖥️
Android (seen on the API 36 emulator; real Android 16 devices not checked)
Uno.Sdk version (and other relevant versions) 📦
- Uno.Sdk 7.0.0-dev.87 (
Uno.WinUIandUno.WinUI.Composition.WebGpu7.0.0-dev.2420) - Android emulator 36.2.12.0 on Windows 11 (WHPX),
-gpu swiftshader_indirect; guest kernel 6.6.66-android15
IDE version 🧑💻
None: dotnet CLI.
Anything else we need to know? 💬
Found while setting up the Uno Gallery's WebGPU canary. Adding an API 36 run to the Android WebGPU lane would cover it.
Activity
ramezgerges commentedon Oct 23, 2026
Root cause: the API 36 emulator image's Vulkan driver, not Uno or wgpu
I reproduced this with a small standalone NDK program (source below) that uses no Uno and no wgpu. It allocates host-visible Vulkan memory, maps it and writes every page, which is what
wgpuQueueWriteBufferdoes with its staging buffer.API 36 (
system-images;android-36;google_apis;x86_64, emulator 37.2.12,-gpu swiftshader_indirect):SIGSEGV SEGV_ACCERR, usually at offset 4096 of the block.API 35 (
android-35, same emulator, same host SwiftShader): 12 blocks totalling 1.4 GB, all writable.The host side is identical, so the defect is in the guest Vulkan driver shipped in the API 36 system image. wgpu keeps its memory blocks mapped and goes past 16 MB within seconds (render targets alone are about 10 MB each), hence the crash in
Queue::write_buffer.Correction: Skia is affected too. SamplesApp with the default Skia backend (Vulkan) crashes on the same API 36 image with the same signature:
SIGSEGV SEGV_ACCERRinmemmove, called fromlibSkiaSharp.so, 7 s after launch. In my earlier runs the emulator process itself crashed before the app got that far, which hid this. So this isn't specific to WebGPU: any app that keeps more than ~16 MB of Vulkan memory allocated on this image can hit it.What we're doing:
Real Android 16 devices use their vendor's Vulkan driver, not this one, so they shouldn't be affected. I haven't checked one.
Repro program (
vkmaptest.c)Build with the NDK (
x86_64-linux-android30-clang -O1 -o vkmaptest vkmaptest.c -lvulkan), thenadb pushit and run/data/local/tmp/vkmaptest 16384 16384 16384 16384. The arguments are block sizes in KB. An optional first argument holds flags:uunmaps each block after writing,falso frees it,p<MB>first allocates that much without mapping it,r<MB>allocates that much and frees it first (rw<MB>also maps and writes it).ci(android): Run the WebGPU lane on API 36
ramezgerges commentedon Oct 26, 2026
Update: fixed in revision 7 of the API 36 image
The emulator side is fixed. Revision 7 of the API 36 system image ships a guest Vulkan driver without the 16 MB mapping fault. Google now publishes revision 7 for both
google_apisandgoogle_apis_playstore.Checked locally with the same
vkmaptestprogram as above, onsystem-images;android-36;google_apis_playstore;x86_64revision 7:Given_Borderalso runs on revision 7 with both WebGPU and Skia (Vulkan), without crashing.What this means:
sdkmanager --installupgrades an already-installed older revision, and the lane now logs thePkg.Revisionit installed.sdkmanager --install "system-images;android-36;google_apis_playstore;x86_64"(or thegoogle_apisvariant), then checkPkg.Revision=7in the image'ssource.properties.-feature -Wifi,-VirtioWifi. I haven't checked whether other hosts need it.So no workaround is needed in Uno or wgpu, and no upstream emulator report is needed either.
ci(android): Run the WebGPU lane on API 36
ci(android): Run the WebGPU lane on API 36
ci(android): Refuse an API 36 image older than revision 7