You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Flutter GPU] FlutterGpuCommandBufferTest aborts in debug builds: CommandBuffer is created on the stack #194149
The three tests in lib/gpu/command_buffer_unittests.cc (FlutterGpuCommandBufferTest.*) abort in an unoptimized debug build:
[ RUN ] FlutterGpuCommandBufferTest.RejectsCompletionCallbacksAfterSubmit
[FATAL:flutter/fml/memory/ref_counted_internal.h(97)] Check failed: !adoption_required_.
[ERROR:flutter/fml/backtrace.cc(108)] Caught signal SIGABRT during program execution.
...
Frame 4: fml::internal::RefCountedThreadSafeBase::~RefCountedThreadSafeBase()
Each test builds the flutter::gpu::CommandBuffer on the stack:
CommandBuffer is ref-counted, and an fml ref-counted object has to be adopted (created through fml::MakeRefCounted) before it is destroyed. A stack instance is never adopted, so its destructor trips the debug check. The check is debug-only, which I assume is why CI doesn't see it.
Steps to reproduce
macOS arm64, an existing host_debug_unopt_arm64 build. The test file is the same on current main.
cd engine/src
ninja -C out/host_debug_unopt_arm64 flutter/lib/gpu:gpu_unittests
out/host_debug_unopt_arm64/gpu_unittests --gtest_filter='FlutterGpuCommandBufferTest.*'
All three tests abort as above. The other gpu_unittests suites pass.
Proposed fix
Create the command buffer with fml::MakeRefCounted<CommandBuffer>(...) in the three tests and use it through the returned fml::RefPtr. No engine code changes.
I ran into this while testing a few Flutter GPU fixes locally; until it's fixed I leave FlutterGpuCommandBufferTest.* out of the gpu_unittests filter in those PRs.
hi id like to work on this issue, i noticed that there are currently no branches or PRs linked to this issue, can u assign it to me?? id like to contribute
Activity
puneetkukreja98 commentedon Oct 12, 2026
@dzolotov Thanks for reporting this, routing this to team-fluttergpu for further investigation.
niharikavuchintala commentedon Oct 12, 2026
hi id like to work on this issue, i noticed that there are currently no branches or PRs linked to this issue, can u assign it to me?? id like to contribute