Skip to content

shell_unittests crashes on local runs #130036

@dnfield

Description

@dnfield

Crash is with a segfault, bt like:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xffffffffffffffe8)
  * frame #0: 0x0000000100925978 shell_unittests`std::_LIBCPP_ABI_NAMESPACE::basic_ostream<char, std::_LIBCPP_ABI_NAMESPACE::char_traits<char> >::sentry::sentry(this=0x000000016fdfb658, __os=0x000000010cf6abe8) at ostream:271:9
    frame #1: 0x0000000100925a4c shell_unittests`std::_LIBCPP_ABI_NAMESPACE::basic_ostream<char, std::_LIBCPP_ABI_NAMESPACE::char_traits<char> >::sentry::sentry(this=0x000000016fdfb658, __os=0x000000010cf6abe8) at ostream:270:1
    frame #2: 0x000000010000f1b0 shell_unittests`std::_LIBCPP_ABI_NAMESPACE::basic_ostream<char, std::_LIBCPP_ABI_NAMESPACE::char_traits<char> >& std::_LIBCPP_ABI_NAMESPACE::__put_character_sequence<char, std::_LIBCPP_ABI_NAMESPACE::char_traits<char> >(__os=0x000000010cf6abe8, __str="[ERROR:flutter/flow/layers/layer_tree.cc(41)] The scene did not specify any layers.\n", __len=84) at ostream:726:57
    frame #3: 0x0000000100015e54 shell_unittests`std::_LIBCPP_ABI_NAMESPACE::basic_ostream<char, std::_LIBCPP_ABI_NAMESPACE::char_traits<char> >& std::_LIBCPP_ABI_NAMESPACE::operator<<<char, std::_LIBCPP_ABI_NAMESPACE::char_traits<char>, std::_LIBCPP_ABI_NAMESPACE::allocator<char> >(__os=0x000000010cf6abe8, __str=0x000000016fdfb730) at ostream:1053:12
    frame #4: 0x00000001009d3130 shell_unittests`fml::LogMessage::~LogMessage(this=0x000000016fdfb908) at logging.cc:93:31
    frame #5: 0x00000001009d324c shell_unittests`fml::LogMessage::~LogMessage(this=0x000000016fdfb908) at logging.cc:87:27
    frame #6: 0x0000000102388f34 shell_unittests`flutter::LayerTree::Preroll(this=0x00000001137080c0, frame=0x0000000113708110, ignore_raster_cache=false, cull_rect=(fLeft = -1.0E+9, fTop = -1.0E+9, fRight = 1.0E+9, fBottom = 1.0E+9)) at layer_tree.cc:41:5
    frame #7: 0x000000010232dcf0 shell_unittests`flutter::CompositorContext::ScopedFrame::Raster(this=0x0000000113708110, layer_tree=0x00000001137080c0, ignore_raster_cache=false, frame_damage=0x0000000000000000) at compositor_context.cc:136:41
    frame #8: 0x0000000100745028 shell_unittests`flutter::Rasterizer::DrawToSurfaceUnsafe(this=0x0000000113709120, frame_timings_recorder=0x00000001137044b0, layer_tree=0x00000001137080c0, device_pixel_ratio=2) at rasterizer.cc:602:27
    frame #9: 0x0000000100742568 shell_unittests`flutter::Rasterizer::DrawToSurface(this=0x0000000113709120, frame_timings_recorder=0x00000001137044b0, layer_tree=0x00000001137080c0, device_pixel_ratio=2) at rasterizer.cc:497:21
    frame #10: 0x0000000100743b30 shell_unittests`flutter::Rasterizer::DoDraw(this=0x0000000113709120, frame_timings_recorder=unique_ptr<flutter::FrameTimingsRecorder, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::FrameTimingsRecorder> > @ 0x000000016fdfc960, layer_tree=unique_ptr<flutter::LayerTree, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTree> > @ 0x000000016fdfc958, device_pixel_ratio=2) at rasterizer.cc:402:7
    frame #11: 0x0000000100752c70 shell_unittests`flutter::Rasterizer::Draw(this=0x000000011370a5d8, item=unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> > @ 0x000000016fdfc9b0)>)::$_1::operator()(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >) const at rasterizer.cc:211:27
    frame #12: 0x0000000100752b44 shell_unittests`decltype(__f=0x000000011370a5d8, __args=0x000000016fdfcb38)>)::$_1&>()(std::declval<std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> > >())) std::_LIBCPP_ABI_NAMESPACE::__invoke[abi:v15000]<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_1&, std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> > >(flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_1&, std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >&&) at invoke.h:403:23
    frame #13: 0x0000000100752a6c shell_unittests`void std::_LIBCPP_ABI_NAMESPACE::__invoke_void_return_wrapper<void, true>::__call<flutter::Rasterizer::Draw(__args=0x000000011370a5d8, __args=0x000000016fdfcb38)>)::$_1&, std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> > >(flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_1&, std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >&&) at invoke.h:488:9
    frame #14: 0x0000000100752a0c shell_unittests`std::_LIBCPP_ABI_NAMESPACE::__function::__alloc_func<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_1, std::_LIBCPP_ABI_NAMESPACE::allocator<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_1>, void (std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >)>::operator(this=0x000000011370a5d8, __arg=0x000000016fdfcb38)[abi:v15000](std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >&&) at function.h:185:16
    frame #15: 0x0000000100750980 shell_unittests`std::_LIBCPP_ABI_NAMESPACE::__function::__func<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_1, std::_LIBCPP_ABI_NAMESPACE::allocator<flutter::Rasterizer::Draw(std::_LIBCPP_ABI_NAMESPACE::shared_ptr<flutter::Pipeline<flutter::LayerTreeItem> > const&, std::_LIBCPP_ABI_NAMESPACE::function<bool (flutter::LayerTree&)>)::$_1>, void (std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >)>::operator(this=0x000000011370a5d0, __arg=0x000000016fdfcb38)(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >&&) at function.h:359:12
    frame #16: 0x0000000100753d4c shell_unittests`std::_LIBCPP_ABI_NAMESPACE::__function::__value_func<void (std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >)>::operator(this=0x000000016fdfce68, __args=0x000000016fdfcb38)[abi:v15000](std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >&&) const at function.h:512:16
    frame #17: 0x00000001007535d0 shell_unittests`std::_LIBCPP_ABI_NAMESPACE::function<void (std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >)>::operator(this=0x000000016fdfce68, __arg=unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> > @ 0x000000016fdfcb38)(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<flutter::LayerTreeItem, std::_LIBCPP_ABI_NAMESPACE::default_delete<flutter::LayerTreeItem> >) const at function.h:1187:12
    frame #18: 0x0000000100742de8 shell_unittests`flutter::Pipeline<flutter::LayerTreeItem>::Consume(this=0x0000000113707fe8, consumer=0x000000016fdfce68)> const&) at pipeline.h:199:5
    frame #19: 0x000000010074299c shell_unittests`flutter::Rasterizer::Draw(this=0x0000000113709120, pipeline=0x000000016fdfd208, discard_callback=flutter::Rasterizer::LayerTreeDiscardCallback @ 0x000000016fdfd8f0)>) at rasterizer.cc:216:52
    frame #20: 0x00000001001c144c shell_unittests`flutter::RasterizerTest_drawWithExternalViewEmbedderAndThreadsMergedExternalViewEmbedderSubmitFrameCalled_Test::TestBody(this=0x000000010cf3dd60) at rasterizer_unittests.cc:340:15
    frame #21: 0x00000001038f56b4 shell_unittests`void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(object=0x000000010cf3dd60, method=20 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00, location="the test body")(), char const*) at gtest.cc:2631:10
    frame #22: 0x00000001038c78e0 shell_unittests`void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(object=0x000000010cf3dd60, method=20 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00, location="the test body")(), char const*) at gtest.cc:2686:12
    frame #23: 0x00000001038c77fc shell_unittests`testing::Test::Run(this=0x000000010cf3dd60) at gtest.cc:2706:5
    frame #24: 0x00000001038c8624 shell_unittests`testing::TestInfo::Run(this=0x000000010cf0b4f0) at gtest.cc:2885:11
    frame #25: 0x00000001038c9c64 shell_unittests`testing::TestSuite::Run(this=0x000000010cf0ae60) at gtest.cc:3044:30
    frame #26: 0x00000001038d6744 shell_unittests`testing::internal::UnitTestImpl::RunAllTests(this=0x000000010cf05ab0) at gtest.cc:5913:44
    frame #27: 0x00000001038fcd44 shell_unittests`bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(object=0x000000010cf05ab0, method=2c 63 8d 03 01 00 00 00 00 00 00 00 00 00 00 00, location="auxiliary test code (environments or event listeners)")(), char const*) at gtest.cc:2631:10
    frame #28: 0x00000001038d6274 shell_unittests`bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(object=0x000000010cf05ab0, method=2c 63 8d 03 01 00 00 00 00 00 00 00 00 00 00 00, location="auxiliary test code (environments or event listeners)")(), char const*) at gtest.cc:2686:12
    frame #29: 0x00000001038d60e0 shell_unittests`testing::UnitTest::Run(this=0x0000000105189a00) at gtest.cc:5482:10
    frame #30: 0x0000000103695b00 shell_unittests`RUN_ALL_TESTS() at gtest.h:2497:46
    frame #31: 0x000000010369599c shell_unittests`main(argc=1, argv=0x000000016fdfe978) at run_all_unittests.cc:64:12
    frame #32: 0x0000000185f43f28 dyld`start + 2236

Reason is that the test added in flutter/engine#42928 fails to release the log capture at the end of the test, and since no log is actually generated by the test it never gets reset - so the next test that tries to print a log has an opportunity to segfault since it will try to deref a dangling pointer.

/cc @gaaclarke @dkwingsmt

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: flakeTests that sometimes, but not always, incorrectly passengineflutter/engine related. See also e: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions