ws: WindowTreeScheduleEmbedTest.ScheduleEmbed crashes when run with WindowServiceTest.DeleteWithClients |
||||
Issue descriptionws: WindowTreeScheduleEmbedTest.ScheduleEmbed crashes when run with WindowServiceTest.DeleteWithClients Running services_unittests locally had a few failures that passed on re-run (original failure logs at bottom). I ran the three flaky fixtures together and noticed that WindowTreeScheduleEmbedTest.ScheduleEmbed was crashing consistently, running without InProcessAudioService/AudioSystemTestTemplate/1.GetInputDeviceDescriptionsNoInputDevices yielded the same result. (1) Build services_unittests on linux-chromeos (target_os = "chromeos") (2) Run: out/Default/services_unittests --gtest_filter=WindowTreeScheduleEmbedTest.ScheduleEmbed:WindowServiceTest.DeleteWithClients Expected: ScheduleEmbed passes, as it does when run independently. Actual: ScheduleEmbed crashes, output below. Kyle, can you take a look for the CreateOffscreenGLSurfaceWithFormat error? https://cs.chromium.org/chromium/src/ui/gl/init/gl_factory_ozone.cc?rcl=e9fa851ff259ed374cdb0af3cf19fbc68562c175&l=102 Note: Google Test filter = WindowServiceTest.DeleteWithClients:WindowTreeScheduleEmbedTest.ScheduleEmbed [==========] Running 2 tests from 2 test cases. [----------] Global test environment set-up. [----------] 1 test from WindowServiceTest [ RUN ] WindowServiceTest.DeleteWithClients [ OK ] WindowServiceTest.DeleteWithClients (98 ms) [----------] 1 test from WindowServiceTest (98 ms total) [----------] 1 test from WindowTreeScheduleEmbedTest [ RUN ] WindowTreeScheduleEmbedTest.ScheduleEmbed [260289:260296:0621/130327.550305:1733706612191:FATAL:gl_factory_ozone.cc(102)] Check failed: false. #0 0x7fd35981951c base::debug::StackTrace::StackTrace() #1 0x7fd35976904b logging::LogMessage::~LogMessage() #2 0x7fd354632ed8 gl::init::CreateOffscreenGLSurfaceWithFormat() #3 0x7fd3546319ed gl::init::CreateOffscreenGLSurface() #4 0x7fd35469c239 gpu::InProcessCommandBuffer::InitializeOnGpuThread() #5 0x7fd3546a29d9 _ZN4base8internal7InvokerINS0_9BindStateIZN3gpu12_GLOBAL__N_118WrapTaskWithResultINS3_13ContextResultEEENS_12OnceCallbackIFvvEEENS7_IFT_vEEEPSA_PNS_13WaitableEventEEUlNS7_IFS6_vEEEPS6_SF_E_JSH_SI_SF_EEES8_E7RunOnceEPNS0_13BindStateBaseE #6 0x7fd35974c045 base::debug::TaskAnnotator::RunTask() #7 0x7fd3597758c9 base::internal::IncomingTaskQueue::RunTask() #8 0x7fd35977925b base::MessageLoop::RunTask() #9 0x7fd3597795ea base::MessageLoop::DeferOrRunPendingTask() #10 0x7fd35977984c base::MessageLoop::DoWork() #11 0x7fd35977bb46 base::MessagePumpDefault::Run() #12 0x7fd359778c44 base::MessageLoop::Run() #13 0x7fd3597ab5a9 base::RunLoop::Run() #14 0x7fd3597e6f87 base::Thread::Run() #15 0x7fd3597e74bd base::Thread::ThreadMain() #16 0x7fd35982c65f base::(anonymous namespace)::ThreadFunc() #17 0x7fd353ece494 start_thread #18 0x7fd353702a8f clone [260283:260288:0621/130327.573286:1733706635291:ERROR:kill_posix.cc(83)] Unable to terminate process group 260289: No such process (3) [1/2] WindowServiceTest.DeleteWithClients (98 ms) [2/2] WindowTreeScheduleEmbedTest.ScheduleEmbed (CRASHED) 1 test crashed: WindowTreeScheduleEmbedTest.ScheduleEmbed (../../services/ui/ws2/window_tree_unittest.cc:1077) Tests took 1 seconds. Here are the original failure logs when running the whole services_unittests executable with no filter: (I'll file a separate bug for the flaky InProcessAudioService fixture failure) [ RUN ] InProcessAudioService/AudioSystemTestTemplate/1.GetInputDeviceDescriptionsNoInputDevices [251093:251093:0621/130152.909208:1733611971077:FATAL:interface_endpoint_client.cc(170)] Check failed: (sequence_checker_).CalledOnValidSequence(). #0 0x7f188a0a751c base::debug::StackTrace::StackTrace() #1 0x7f1889ff704b logging::LogMessage::~LogMessage() #2 0x7f18896ddf94 mojo::InterfaceEndpointClient::~InterfaceEndpointClient() #3 0x7f18896de09e mojo::InterfaceEndpointClient::~InterfaceEndpointClient() #4 0x7f18896d6787 mojo::internal::BindingStateBase::Close() #5 0x7f18888a367f service_manager::ServiceContext::QuitNow() #6 0x00000075d851 audio::ServiceTestClient::AudioThreadContext::~AudioThreadContext() #7 0x00000075d5b9 audio::ServiceTestClient::~ServiceTestClient() #8 0x00000075d62e audio::ServiceTestClient::~ServiceTestClient() #9 0x7f18888a3431 service_manager::ServiceContext::~ServiceContext() #10 0x7f18888a345e service_manager::ServiceContext::~ServiceContext() #11 0x00000075822e audio::InProcessServiceTest<>::TearDown() #12 0x000000ac6f40 testing::TestInfo::Run() #13 0x000000ac7457 testing::TestCase::Run() #14 0x000000ad2a57 testing::internal::UnitTestImpl::RunAllTests() #15 0x000000ad25cd testing::UnitTest::Run() #16 0x000000ce5631 base::TestSuite::Run() #17 0x000000cec730 base::(anonymous namespace)::LaunchUnitTestsInternal() #18 0x000000cec590 base::LaunchUnitTests() #19 0x000000cd4010 service_manager::InitializeAndLaunchUnitTests() #20 0x000000a25819 main #21 0x7f1883ec82b1 __libc_start_main #22 0x0000004f17da _start ... [ RUN ] WindowServiceTest.DeleteWithClients [252553:254017:0621/130155.662306:1733614724144:FATAL:gl_factory_ozone.cc(102)] Check failed: false. #0 0x7fb28b22c51c base::debug::StackTrace::StackTrace() #1 0x7fb28b17c04b logging::LogMessage::~LogMessage() #2 0x7fb286045ed8 gl::init::CreateOffscreenGLSurfaceWithFormat() #3 0x7fb2860449ed gl::init::CreateOffscreenGLSurface() #4 0x7fb2860af239 gpu::InProcessCommandBuffer::InitializeOnGpuThread() #5 0x7fb2860b59d9 _ZN4base8internal7InvokerINS0_9BindStateIZN3gpu12_GLOBAL__N_118WrapTaskWithResultINS3_13ContextResultEEENS_12OnceCallbackIFvvEEENS7_IFT_vEEEPSA_PNS_13WaitableEventEEUlNS7_IFS6_vEEEPS6_SF_E_JSH_SI_SF_EEES8_E7RunOnceEPNS0_13BindStateBaseE #6 0x7fb28b15f045 base::debug::TaskAnnotator::RunTask() #7 0x7fb28b1888c9 base::internal::IncomingTaskQueue::RunTask() #8 0x7fb28b18c25b base::MessageLoop::RunTask() #9 0x7fb28b18c5ea base::MessageLoop::DeferOrRunPendingTask() #10 0x7fb28b18c84c base::MessageLoop::DoWork() #11 0x7fb28b18eb46 base::MessagePumpDefault::Run() #12 0x7fb28b18bc44 base::MessageLoop::Run() #13 0x7fb28b1be5a9 base::RunLoop::Run() #14 0x7fb28b1f9f87 base::Thread::Run() #15 0x7fb28b1fa4bd base::Thread::ThreadMain() #16 0x7fb28b23f65f base::(anonymous namespace)::ThreadFunc() #17 0x7fb2858e1494 start_thread #18 0x7fb285115a8f clone ... [ RUN ] WindowTreeScheduleEmbedTest.ScheduleEmbed [252909:254251:0621/130156.102604:1733615164431:FATAL:gl_factory_ozone.cc(102)] Check failed: false. #0 0x7f86b1f7051c base::debug::StackTrace::StackTrace() #1 0x7f86b1ec004b logging::LogMessage::~LogMessage() #2 0x7f86acd89ed8 gl::init::CreateOffscreenGLSurfaceWithFormat() #3 0x7f86acd889ed gl::init::CreateOffscreenGLSurface() #4 0x7f86acdf3239 gpu::InProcessCommandBuffer::InitializeOnGpuThread() #5 0x7f86acdf99d9 _ZN4base8internal7InvokerINS0_9BindStateIZN3gpu12_GLOBAL__N_118WrapTaskWithResultINS3_13ContextResultEEENS_12OnceCallbackIFvvEEENS7_IFT_vEEEPSA_PNS_13WaitableEventEEUlNS7_IFS6_vEEEPS6_SF_E_JSH_SI_SF_EEES8_E7RunOnceEPNS0_13BindStateBaseE #6 0x7f86b1ea3045 base::debug::TaskAnnotator::RunTask() #7 0x7f86b1ecc8c9 base::internal::IncomingTaskQueue::RunTask() #8 0x7f86b1ed025b base::MessageLoop::RunTask() #9 0x7f86b1ed05ea base::MessageLoop::DeferOrRunPendingTask() #10 0x7f86b1ed084c base::MessageLoop::DoWork() #11 0x7f86b1ed2aca base::MessagePumpDefault::Run() #12 0x7f86b1ecfc44 base::MessageLoop::Run() #13 0x7f86b1f025a9 base::RunLoop::Run() #14 0x7f86b1f3df87 base::Thread::Run() #15 0x7f86b1f3e4bd base::Thread::ThreadMain() #16 0x7f86b1f8365f base::(anonymous namespace)::ThreadFunc() #17 0x7f86ac625494 start_thread #18 0x7f86abe59a8f clone
,
Jun 25 2018
The test suite calls OzonePlatform::InitializeForGPU() once before any test cases run. At the start of each test case OzonePlatform::InitializeForUI() runs. When WindowTreeScheduleEmbedTest.ScheduleEmbed finishes it calls OzonePlatform::Shutdown() which destroys both the UI and GPU parts of OzonePlatform. When WindowTreeScheduleEmbedTest.ScheduleEmbed runs afterwards the GPU part of OzonePlatform doesn't exist which doesn't work. When the test reruns the test suite initialization runs again and the test passes. Unfortunately the UI and GPU parts of OzonePlatform end up in the same object when InitializeForUI() and InitialieForGpu() are called in the same process. When OzonePlatform::Shutdown() was added this became a problem. I think some other test targets fixed this by not destroying aura::Env at the end of each test?
,
Jun 25 2018
Should individual test cases not be calling OzonePlatform::InitializeForUI()/Shutdown()? It might be nice if all the ozone setup/teardown was handled by the test suite.
,
Jun 26 2018
Ideally yes I think the OzonePlatform object should only be created at test suite initialization and destroyed at test suite teardown so it only happens once. It's actually the tests creating/destroying aura::Env which indirectly create/destroy OzonePlatform so it might be more complicated? OzonePlatform::Shutdown() was added in https://crrev.com/2795503002. jamescook/rjkroege likely have a better understanding of why it was required.
,
Jun 26 2018
Hrm, I don't really remember, but I think I needed to create my own TestOzonePlatform to vend StubWindows: https://codereview.chromium.org/2795503002/diff/160001/services/ui/ws/platform_display_default_unittest.cc I'm guessing that since I subclassed OzonePlatform I needed to reset the singleton at the end of the test, so Shutdown() was a workaround for that.
,
Jul 18
I observed the same failure with WindowTreeTest2.PerformDragDrop running services_unittests: [ RUN ] WindowTreeTest2.PerformDragDrop [129495:130578:0718/113733.793829:4061352855587:FATAL:gl_factory_ozone.cc(102)] Check failed: false. #0 0x7fd905c5a48c base::debug::StackTrace::StackTrace() #1 0x7fd905b8d7bb logging::LogMessage::~LogMessage() #2 0x7fd900a89f98 gl::init::CreateOffscreenGLSurfaceWithFormat() #3 0x7fd900a88aad gl::init::CreateOffscreenGLSurface() #4 0x7fd900ab287c gpu::InProcessCommandBuffer::InitializeOnGpuThread() #5 0x7fd900ab9441 _ZN4base8internal7InvokerINS0_9BindStateIZN3gpu12_GLOBAL__N_118WrapTaskWithResultINS3_13ContextResultEEENS_12OnceCallbackIFvvEEENS7_IFT_vEEEPSA_PNS_13WaitableEventEEUlNS7_IFS6_vEEEPS6_SF_E_JSH_SI_SF_EEES8_E7RunOnceEPNS0_13BindStateBaseE #6 0x7fd905b70a15 base::debug::TaskAnnotator::RunTask() #7 0x7fd905b9d94a base::MessageLoop::RunTask() #8 0x7fd905b9dcda base::MessageLoop::DeferOrRunPendingTask() #9 0x7fd905b9dfd7 base::MessageLoop::DoWork() #10 0x7fd905ba08f6 base::MessagePumpDefault::Run() #11 0x7fd905b9d374 base::MessageLoop::Run() #12 0x7fd905bcf319 base::RunLoop::Run() #13 0x7fd905c26b47 base::Thread::Run() #14 0x7fd905c2707d base::Thread::ThreadMain() #15 0x7fd905c6d5cf base::(anonymous namespace)::ThreadFunc() #16 0x7fd900274494 start_thread #17 0x7fd8ffaa8a8f clone [1426/1978] WindowTreeTest2.PerformDragDrop (CRASHED)
,
Jul 21
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/13115867c7947651db1b67695352af94deb4f2ad commit 13115867c7947651db1b67695352af94deb4f2ad Author: Mike Wasserman <msw@chromium.org> Date: Sat Jul 21 02:16:15 2018 services_unittests: remove OzonePlatform shutdown and redundant init. Remove problematic OzonePlatform::Shutdown method. (per-process gpu init was torn down with per-fixture aura::Env dtor) Remove redundant run_all_service_tests GPU init of OzonePatform (done as needed via WindowServiceTestSetup / GLSurfaceTestSupport) Remove obsolete WindowTreeClientWmOzoneTest aura_unittests fixture. Add some gl_factory_ozone.cc failure logging. Bug: 855191 Test: No regressions, no problems running services_unittests, etc. Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel Change-Id: If798b639e626738e3ba6d4c4a550cf3cc02c70ab Reviewed-on: https://chromium-review.googlesource.com/1144186 Commit-Queue: Michael Wasserman <msw@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Michael Spang <spang@chromium.org> Cr-Commit-Position: refs/heads/master@{#577061} [modify] https://crrev.com/13115867c7947651db1b67695352af94deb4f2ad/services/test/BUILD.gn [modify] https://crrev.com/13115867c7947651db1b67695352af94deb4f2ad/services/test/run_all_service_tests.cc [modify] https://crrev.com/13115867c7947651db1b67695352af94deb4f2ad/ui/aura/env.cc [modify] https://crrev.com/13115867c7947651db1b67695352af94deb4f2ad/ui/aura/mus/window_tree_client_unittest.cc [modify] https://crrev.com/13115867c7947651db1b67695352af94deb4f2ad/ui/gl/init/gl_factory_ozone.cc [modify] https://crrev.com/13115867c7947651db1b67695352af94deb4f2ad/ui/ozone/public/ozone_platform.cc [modify] https://crrev.com/13115867c7947651db1b67695352af94deb4f2ad/ui/ozone/public/ozone_platform.h
,
Jul 21
Should be fixed |
||||
►
Sign in to add a comment |
||||
Comment 1 by sky@chromium.org
, Jun 22 2018