Skip to content

Persistent crash in FTL quick_actions Android tests #170141

Description

@stuartmorgan-g

The flutter/flutter -> flutter/packages roller is very behind due to persistent failures in quick_actions tests, and by binary searching the roller failures I've narrowed it down to:
8b18dde...8abf4e7

It's definitely not the README.md change, which leaves #169548 as the cause of the regression.

I don't have a lot of details about what's going wrong; it repros on FTL, but not our emulator tests (I guess those probably don't have Impeller support?) so may require a physical device to repro. Here's an example failure:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8712810564588405377/+/u/Run_package_tests/Firebase_Test_Lab/stdout
with the details being at
https://firebase.corp.google.com/project/flutter-infra-staging/testlab/histories/bh.7ef00c6ad97f5668/matrices/7655350001675281711

The crash is:

Build fingerprint: 'google/panther/panther:13/TQ3A.230605.012/10204971:user/release-keys'
Revision: 'MP1.0'
ABI: 'arm64'
Timestamp: 2025-06-06 05:59:00.266390835-0700
Process uptime: 14s
Cmdline: io.flutter.plugins.quickactionsexample
pid: 22301, tid: 23317, name: 5.raster  >>> io.flutter.plugins.quickactionsexample <<<
uid: 10261
tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000000
Cause: null pointer dereference
    x0  0000000000000000  x1  b40000725a5db5c8  x2  000000728a5be850  x3  0000007167b7ff08
    x4  00000000000000b0  x5  0000007167b800d0  x6  0000000000000000  x7  0000000000000000
    x8  0000007167b803e0  x9  0000000000002484  x10 00000000000000c0  x11 0000000000000012
    x12 0000000000001965  x13 0000007167b80cb0  x14 0000000000000001  x15 0000000000000000
    x16 0000000000000001  x17 00000074a10a2050  x18 000000715a910000  x19 b40000727a5ed7d0
    x20 b40000725a5db5d8  x21 b40000725a5db5d8  x22 0000007167b81000  x23 0000007167b80260
    x24 b4000072aa5f98a0  x25 b4000072aa5f97e8  x26 b4000072aa5fc088  x27 0000000000000000
    x28 00000000ffffffff  x29 0000007167b80b40
    lr  00000071758556a0  sp  0000007167b80130  pc  0000007175734e14  pst 0000000060001000
backtrace:
      #00 pc 0000000002011e14  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #01 pc 000000000213269c  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #02 pc 000000000211f7d4  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #03 pc 000000000211f720  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #04 pc 00000000021c5fec  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #05 pc 00000000021c5f60  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #06 pc 00000000021c5f14  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #07 pc 00000000021c5ed8  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #08 pc 000000000223abe0  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #09 pc 0000000001d3c278  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #10 pc 0000000001d3c1f4  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #11 pc 0000000001d3b6e8  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #12 pc 0000000001d41d6c  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #13 pc 00000000021c322c  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #14 pc 0000000001d680c0  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #15 pc 0000000001d6dbb8  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #16 pc 0000000000011178  /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+808) (BuildId: 0b4a793fa8045c04066d988c68bac8bb)
      #17 pc 00000000000185e4  /system/lib64/libandroid.so (ALooper_pollOnce+100) (BuildId: 682dab490c18361d5d6527bcdd86cdfa)
      #18 pc 0000000001d6db40  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #19 pc 0000000001d6800c  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #20 pc 0000000001d6be84  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #21 pc 0000000001d6bd1c  /data/app/~~fWTBr9sLV22lvFsq3YFwIw==/io.flutter.plugins.quickactionsexample-0GOsWfUWd5lBOgNtRoebcQ==/lib/arm64/libflutter.so (BuildId: 251a17d7a01de9ac247d124025d8a467244fe69e)
      #22 pc 00000000000c226c  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: dc4001c2ef2dfc23467040797a96840c)
      #23 pc 0000000000054a30  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: dc4001c2ef2dfc23467040797a96840c)

but I'm not sure if there's a way to symbolicate that.

The failing test is appShortcutLaunchActivityAfterStarting, whose logic is here

I can disable the test for now to unblock the roller, but the fact that the change is reliably crashing a test app is concerning.

Activity

  1. stuartmorgan-g commented on Jun 6, 2025

    @stuartmorgan-g
    ContributorAuthor

    /cc @jason-simmons @jonahwilliams to investigate, as the people familiar with the PR.

  2. added
    platform-androidAndroid applications specifically
    engineflutter/engine related. See also e: labels.
    packageflutter/packages repository. See also p: labels.
    e: impellerImpeller rendering backend issues and features requests
    fyi-androidFor the attention of Android platform team
    c: regressionIt was better in the past than it is now
    c: crashStack traces logged to the console
    c: fatal crashCrashes that terminate the process
    on Jun 6, 2025
  3. added a commit that references this issue on Jun 6, 2025
  4. added
    P1High-priority issues at the top of the work list
    on Jun 9, 2025
  5. jason-simmons commented on Jun 10, 2025

    @jason-simmons
    Member

    Symbolized the stack trace using the android_debug_arm64 build of commit 8abf4e7

    A call to ContextVK::CreateCommandBuffer apparently returned null. This caused a crash when the ContentContext constructor tried to call CreateBlitPass on the null command buffer.

    flutter/impeller/renderer/command_buffer.cc:52
    flutter/impeller/entity/contents/content_context.cc:576
    flutter/third_party/libcxx/include/__memory/unique_ptr.h:754
    flutter/impeller/display_list/aiks_context.cc:21
    flutter/third_party/libcxx/include/__memory/allocator.h:153
    flutter/third_party/libcxx/include/__memory/allocator_traits.h:309
    flutter/third_party/libcxx/include/__memory/shared_ptr.h:734
    flutter/third_party/libcxx/include/__memory/shared_ptr.h:742
    flutter/shell/gpu/gpu_surface_vulkan_impeller.cc:57
    flutter/third_party/libcxx/include/__memory/unique_ptr.h:754
    flutter/shell/platform/android/android_surface_vk_impeller.cc:52
    flutter/shell/platform/android/android_surface_dynamic_impeller.cc:37
    flutter/shell/platform/android/platform_view_android.cc:416
    flutter/shell/common/platform_view.cc:68
    flutter/third_party/libcxx/include/__functional/function.h:995
    
  6. jonahwilliams commented on Jun 10, 2025

    @jonahwilliams
    Contributor

    Hmm, is the command pool geting reset while its in use.

    Do we get any validation errors with --enable-vulkan-validation?

  7. jason-simmons commented on Jun 11, 2025

    @jason-simmons
    Member

    Reproduced this locally on a Pixel 3 by running the io.flutter.plugins.quickactionsexample.QuickActionsTest test suite and reenabling the appShortcutLaunchActivityAfterStarting test.

    A Vulkan validation error is logged midway through the tests (during the quickActionPluginIsAdded test)

    --- Vulkan Debug Report  ----------------------------------------
    |                Severity: Error
    |                    Type: { Validation }
    |                 ID Name: VUID-vkDestroyCommandPool-commandPool-00041
    |               ID Number: -1387836198
    |       Queue Breadcrumbs: [NONE]
    |  CMD Buffer Breadcrumbs: [NONE]
    |         Related Objects: CommandBuffer [516903660592] [EntityPass Command Buffer], CommandPool [769658139443900] [UNNAMED]
    |                 Trigger: Validation Error: [ VUID-vkDestroyCommandPool-commandPool-00041 ] Object 0: handle = 0x7859dbec30, name = EntityPass Command Buffer, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x2bc00000002bc, type = VK_OBJECT_TYPE_COMMAND_POOL; | MessageID = 0xad474cda | vkDestroyCommandPool(): (VkCommandBuffer 0x7859dbec30[EntityPass Command Buffer]) is in use.
    The Vulkan spec states: All VkCommandBuffer objects allocated from commandPool must not be in the pending state (https://docs.vulkan.org/spec/latest/chapters/cmdbuffers.html#VUID-vkDestroyCommandPool-commandPool-00041)
    
  8. jason-simmons commented on Jun 25, 2025

    @jason-simmons
    Member

    This crash happens because ContextVK was using a thread-local counter to assign the value returned by ContextVK::GetHash.

    CommandPoolRecyclerVK uses these hashes as keys in a process-wide global map, and it depends on the key being unique for each active ContextVK instance.

    This test was creating an Android activity containing a Flutter view, spawning another activity containing a Flutter view, and then returning to the first activity. The second activity's engine used different task runner threads. Because the ContextVK assigned hashes using the thread-local counter, the ContextVK created by the first engine had the same hash as the one created by the second engine.

    When the second engine shut down, it called CommandPoolRecyclerVK::DestroyThreadLocalPools to destroy all pools associated with the second engine's ContextVK hash. But since the first engine had the same hash, its pools were also destroyed. The first engine was then unable to create command buffers when the first activity was restored to the foreground.

  9. added a commit that references this issue on Jun 25, 2025
  10. github-actions commented on Jul 9, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: crashStack traces logged to the consolec: fatal crashCrashes that terminate the processc: regressionIt was better in the past than it is nowe: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.fyi-androidFor the attention of Android platform teamp: quick_actionsQuickActions pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions