Skip to content

Android Skia (Vulkan): Debug.Assert in NativeDispatcher.EnqueueRender aborts the app when the UI thread is slow to drain a render request #25303

Closed

Description

@MartinZikmund

Current behavior

On Skia Android with the Vulkan render view, a Debug build can abort on the render thread:

---- DEBUG ASSERTION FAILED ----
details.renderAction is null
  at Uno.UI.Dispatching.NativeDispatcher.EnqueueRender(Object compositionTarget, Action handler)
  at Microsoft.UI.Xaml.Media.CompositionTarget.OnNativePlatformFrameRequested(...)
  at Uno.UI.Runtime.Android.UnoVulkanView.RenderFrame()
  at Uno.UI.Runtime.Android.UnoVulkanView.RenderLoop(Object state)
Fatal signal 6 (SIGABRT) ... (UnoVulkanRender)

It is intermittent (seen 3 times in roughly 10-15 launches), and always on the first launch after an install (cold start). Each time it was preceded by:

  • CompositionTarget#...: a render request has been outstanding for 2290-4015ms with no frame from the host ... asking again.
  • Choreographer Skipped 103-261 frames (UI thread busy).

The following launches were fine. It happened on a heavy page and on a trivial one (Buttons/Button_Events), so a slow cold start is enough.

Expected behavior

No crash. A second render request that arrives while one is still queued should coalesce. The code after the assert already does that: it replaces the handler and does not enqueue again.

How to reproduce it

Not deterministic, and I did not build a minimal repro. This was confirmed by code inspection plus the logcat above.

  1. Build the Skia Android SamplesApp (or any Skia Android app) in Debug, on an API 35 x86_64 emulator with Vulkan.
  2. Run dotnet build -t:Install and launch right after the install (cold dex, UI thread slow for a few seconds).
  3. Repeat launches until the abort shows up in logcat.

Workaround

Use a Release build (Debug.Assert is compiled out), or set FeatureConfiguration.Rendering.UseVulkanOnSkiaAndroid = false to avoid the Vulkan view.

Works on UWP/WinUI

N/A (Uno internal render scheduling)

Environment

Uno Platform master @ 951b7b464b8 (the same code was present at the merge base of recent PRs), Debug, net10.0-android, Skia renderer, API 35 x86_64 emulator with Vulkan.

Affected platforms

Skia Android (Vulkan render view), Debug builds only.

Anything else we need to know?

Root cause (source-backed):

  1. The render thread calls OnNativePlatformFrameRequested every frame (from UnoVulkanView.RenderFrame). It calls NativeDispatcher.Main.EnqueueRender only when _shouldEnqueueRenderOnNextNativePlatformFrameRequested swaps from true to false.
  2. The flag is normally set back to true only by EnqueueRenderCallback, i.e. after the UI thread has run the queued render action.
  3. The stall recovery in IsRenderRequestStalled (called from RequestNewFrame on the UI thread) also sets the flag to true after a request has been outstanding for a while. That is exactly the "asking again" warning in the log.
  4. If the UI thread is busy, the render action queued by the previous frame is still pending when that happens. The next render-thread frame then sees the flag true and calls EnqueueRender again while details.renderAction is non-null.
  5. NativeDispatcher.EnqueueRender asserts details.renderAction is null. The code right below it handles the non-null case correctly (no second _globalCount increment, just replaces the handler), so the assert is stricter than the real contract. On Android a failed Debug.Assert is a FailFast.

Suggested fix: drop the Debug.Assert in EnqueueRender (or turn it into a trace line), since the stall-recovery path legitimately re-requests while an action is queued. Alternatively, have IsRenderRequestStalled not re-arm the flag while a render action is still pending.

The same pattern may affect the other Android render views (UnoCanvasView, UnoWebGpuView), since they call the same OnNativePlatformFrameRequested; not checked at runtime.

Activity

  1. added
    kind/bug
    platform/android 🤖
    triage/untriaged
    area/skia ✏️
    project/core-tools 🛠️
    difficulty/starter 🚀
    7.0
    on Oct 11, 2026
  2. removed
    triage/untriaged
    7.0
    on Oct 29, 2026
  3. self-assigned this
    on Nov 2, 2026
  4. added 6 commits that reference this issue on Nov 2, 2026
    9748755
    fde5b68
    192c1c8
    bf23f36
    1d9d836
    8e7f7ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/skia ✏️difficulty/starter 🚀kind/bugplatform/android 🤖project/core-tools 🛠️

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions