Skip to content

HandleUsingDestroyedMutex assert can occur on Impeller/Vulkan if a command is submitted after shutdown of the FenceWaiter #187703

Description

@jason-simmons

One way to reproduce this:

  • Run Gallery on Android with Impeller/Vulkan using a host_debug_unopt build
  • Go to the Shrine demo
  • Scroll quickly though the images
  • Use the Android back gesture to suspend the app before all of the images have been decoded and displayed

On a Pixel 6a, the Mali Vulkan implementation may abort with a call to HandleUsingDestroyedMutex that triggers an assert:
Abort message: 'FORTIFY: pthread_mutex_lock called on a destroyed mutex (0xb4000074243e87c4)

This happens because CommandQueueVK::Submit submitted a command buffer with a fence that is then passed to FenceWaiterVK::AddFence. But AddFence fails because the FenceWaiterVK was terminated during engine shutdown.

AddFence then destroys the fence, but the Vulkan implementation still associates the fence with the command buffer. The assert then happens when the command buffer completes and attempts to signal the destroyed fence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work liste: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallyteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions