flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.13k stars 27.47k forks source link

`FlTextureRegistrarTest.RegistrarRegisterTextureInMultipleThreads` crashes sometimes #138197

Open gaaclarke opened 12 months ago

gaaclarke commented 12 months ago

Seen in eb89b9440520672aadde05b26e0cdbbaa6668add

$ autoninja -C out/host_debug_unopt flutter_linux_unittests
$ ./out/host_debug_unopt/flutter_linux_unittests --gtest_filter=*RegistrarRegisterTextureInMultipleThreads* --gtest_repeat=100

..
Repeating all tests (iteration 72) . . .

Note: Google Test filter = *RegistrarRegisterTextureInMultipleThreads*
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from FlTextureRegistrarTest
[ RUN      ] FlTextureRegistrarTest.RegistrarRegisterTextureInMultipleThreads
Segmentation fault
gaaclarke commented 12 months ago

I tried to reproduce this with lldb attached and I couldn't get it.

One failure I had in my pr looked like this. I'm not 100% certain it's the same issue:

Note: Google Test filter = FlTextureRegistrarTest.RegistrarRegisterTextureInMultipleThreads
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from FlTextureRegistrarTest
[ RUN      ] FlTextureRegistrarTest.RegistrarRegisterTextureInMultipleThreads
AddressSanitizer:DEADLYSIGNAL
=================================================================
==244150==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x55662fcfd030 bp 0x7f9b882d37d0 sp 0x7f9b882d3580 T8)
==244150==The signal is caused by a READ memory access.
==244150==Hint: this fault was caused by a dereference of a high value address (see register values below).  Disassemble the provided pc to learn which register was used.
    #0 0x55662fcfd030 in std::_LIBCPP_ABI_NAMESPACE::pair<std::_LIBCPP_ABI_NAMESPACE::__hash_iterator<std::_LIBCPP_ABI_NAMESPACE::__hash_node<std::_LIBCPP_ABI_NAMESPACE::__hash_value_type<long, _FlutterEngineTexture>, void*>*>, bool> std::_LIBCPP_ABI_NAMESPACE::__hash_table<std::_LIBCPP_ABI_NAMESPACE::__hash_value_type<long, _FlutterEngineTexture>, std::_LIBCPP_ABI_NAMESPACE::__unordered_map_hasher<long, std::_LIBCPP_ABI_NAMESPACE::__hash_value_type<long, _FlutterEngineTexture>, std::_LIBCPP_ABI_NAMESPACE::hash<long>, std::_LIBCPP_ABI_NAMESPACE::equal_to<long>, true>, std::_LIBCPP_ABI_NAMESPACE::__unordered_map_equal<long, std::_LIBCPP_ABI_NAMESPACE::__hash_value_type<long, _FlutterEngineTexture>, std::_LIBCPP_ABI_NAMESPACE::equal_to<long>, std::_LIBCPP_ABI_NAMESPACE::hash<long>, true>, std::_LIBCPP_ABI_NAMESPACE::allocator<std::_LIBCPP_ABI_NAMESPACE::__hash_value_type<long, _FlutterEngineTexture>>>::__emplace_unique_key_args<long, std::_LIBCPP_ABI_NAMESPACE::piecewise_construct_t const&, std::_LIBCPP_ABI_NAMESPACE::tuple<long const&>, std::_LIBCPP_ABI_NAMESPACE::tuple<>>(long const&, std::_LIBCPP_ABI_NAMESPACE::piecewise_construct_t const&, std::_LIBCPP_ABI_NAMESPACE::tuple<long const&>&&, std::_LIBCPP_ABI_NAMESPACE::tuple<>&&) /b/f/w/out/host_debug_unopt/../../third_party/libcxx/include/__hash_table:1994:31
    #1 0x55662fcfcc48 in std::_LIBCPP_ABI_NAMESPACE::unordered_map<long, _FlutterEngineTexture, std::_LIBCPP_ABI_NAMESPACE::hash<long>, std::_LIBCPP_ABI_NAMESPACE::equal_to<long>, std::_LIBCPP_ABI_NAMESPACE::allocator<std::_LIBCPP_ABI_NAMESPACE::pair<long const, _FlutterEngineTexture>>>::operator[](long const&) /b/f/w/out/host_debug_unopt/../../third_party/libcxx/include/unordered_map:1804:21
    #2 0x55662fcf1279 in (anonymous namespace)::FlutterEngineRegisterExternalTexture(_FlutterEngine*, long) /b/f/w/out/host_debug_unopt/../../flutter/shell/platform/linux/testing/mock_engine.cc:490:3
    #3 0x55662fd3ad7a in fl_engine_register_external_texture /b/f/w/out/host_debug_unopt/../../flutter/shell/platform/linux/fl_engine.cc:882:10
    #4 0x55662fdb1365 in register_texture(_FlTextureRegistrar*, _FlTexture*) /b/f/w/out/host_debug_unopt/../../flutter/shell/platform/linux/fl_texture_registrar.cc:107:9
    #5 0x55662fdb045e in fl_texture_registrar_register_texture /b/f/w/out/host_debug_unopt/../../flutter/shell/platform/linux/fl_texture_registrar.cc:188:10
    #6 0x55662fc4afc2 in add_mock_texture_to_registrar(void*) /b/f/w/out/host_debug_unopt/../../flutter/shell/platform/linux/fl_texture_registrar_test.cc:73:3
    #7 0x55662f8367f8 in asan_thread_start(void*) ../llvm_build/tools/clang/stage2-bins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/asan/asan_interceptors.cpp:234:28
    #8 0x7f9b92864608 in start_thread /build/glibc-BHL3KM/glibc-2.31/nptl/pthread_create.c:477:8
    #9 0x7f9b92614132 in __clone /build/glibc-BHL3KM/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
gaaclarke commented 12 months ago

fyi @robert-ancell

jonahwilliams commented 11 months ago

FYI @cbracken these tests have been occassionally flakey.

gspencergoog commented 11 months ago

cc @robert-ancell

aam commented 10 months ago

just crashed again https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8761254151804008657/+/u/test:_test:_Host_Tests_for_host_debug_unopt/stdout

reidbaker commented 9 months ago

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8757419753986007841/+/u/test:_test:_Host_Tests_for_host_debug_unopt/stdout

this was a timeout instead of a segfault

zanderso commented 8 months ago

This test is now hitting flaky ASAN failures.

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8754197470573696369/+/u/test:_test:_Host_Tests_for_host_debug_unopt__2_/stdout?format=raw

I am going to disable it, and bump the priority of this issue.

zanderso commented 8 months ago

Disabling in https://github.com/flutter/engine/pull/51231 cc @cbracken

cbracken commented 8 months ago

/cc @robert-ancell FYI

flutter-triage-bot[bot] commented 3 months ago

This issue is assigned to @robert-ancell but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

flutter-triage-bot[bot] commented 1 month ago

This issue was assigned to @robert-ancell but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.