blink_heap_unittests not repeatable or shuffle-able |
|
Issue descriptionRunning blink_heap_unittests in a debug build crashes if you attempt to use --gtest_shuffle or --gtest_repeat, for two main reasons: * various static member counts of how often destructors have been called during finalization are not reset * various tests leave the GC in an unclean state, and subsequent tests can fail because of this - the GC is left in the sweeping phase - the statistics collector may not start due to this unclean state
,
Oct 31
Some examples of bugs I was seeing regarding the GC state, the stats_collector bug: [ RUN ] HeapTest.TestClearOnShutdown [ OK ] HeapTest.TestClearOnShutdown (40 ms) [ RUN ] HeapTest.DerivedMultipleMixins [63629:63629:1031/165856.713358:1406245096500:FATAL:heap_stats_collector.cc(13)] Check failed: is_started_. #0 0x000009a1519d base::debug::StackTrace::StackTrace() #1 0x000009771daa base::debug::StackTrace::StackTrace() #2 0x0000097a2d9b logging::LogMessage::~LogMessage() #3 0x00000747d52b blink::ThreadHeapStatsCollector::IncreaseMarkedObjectSize() #4 0x00000747d455 blink::ThreadHeap::IncreaseMarkedObjectSize() #5 0x00000748cbc7 blink::NormalPage::MakeConsistentForMutator() #6 0x0000074803a1 blink::BaseArena::MakeConsistentForMutator() #7 0x00000747ffd9 blink::ThreadHeap::MakeConsistentForMutator() #8 0x00000747f7a6 blink::ThreadHeap::ObjectPayloadSizeForTesting() #9 0x0000030e5602 blink::ClearOutOldGarbage() #10 0x0000031339a4 blink::HeapTest_DerivedMultipleMixins_Test::TestBody() #11 0x0000035aa06e testing::internal::HandleSehExceptionsInMethodIfSupported<>() #12 0x00000359a8d2 testing::internal::HandleExceptionsInMethodIfSupported<>() #13 0x000003579d56 testing::Test::Run() #14 0x00000357a755 testing::TestInfo::Run() #15 0x00000357b4ff testing::TestCase::Run() #16 0x00000358f348 testing::internal::UnitTestImpl::RunAllTests() #17 0x0000035aa0fe testing::internal::HandleSehExceptionsInMethodIfSupported<>() #18 0x00000359c122 testing::internal::HandleExceptionsInMethodIfSupported<>() #19 0x00000358efa7 testing::UnitTest::Run() #20 0x000009a817d1 RUN_ALL_TESTS() #21 0x000009a7e7ab base::TestSuite::Run() #22 0x00000315588b runHelper() #23 0x00000330ff00 _ZN4base8internal13FunctorTraitsIPFiPNS_9TestSuiteEEvE6InvokeIS5_JS3_EEEiOT_DpOT0_ #24 0x00000330fe8d _ZN4base8internal12InvokeHelperILb0EiE8MakeItSoIPFiPNS_9TestSuiteEEJS5_EEEiOT_DpOT0_ #25 0x00000330fe55 _ZN4base8internal7InvokerINS0_9BindStateIPFiPNS_9TestSuiteEEJNS0_17UnretainedWrapperIS3_EEEEEFivEE7RunImplIS6_NSt3__15tupleIJS8_EEEJLm0EEEEiOT_OT0_NSD_16integer_sequenceImJXspT1_EEEE #26 0x0000033925d9 _ZN4base8internal7InvokerINS0_9BindStateIPFiPNS_9TestSuiteEEJNS0_17UnretainedWrapperIS3_EEEEEFivEE7RunOnceEPNS0_13BindStateBaseE #27 0x0000048431be _ZNO4base12OnceCallbackIFivEE3RunEv #28 0x000009a8b905 base::(anonymous namespace)::LaunchUnitTestsInternal() #29 0x000009a8b755 base::LaunchUnitTests() #30 0x000003155960 main #31 0x7f848059eb97 __libc_start_main #32 0x0000030dd02a _start
,
Oct 31
And the phase bug (this is only triggered in debug mode, when SetGCPhase is strict about the state transitions) [ RUN ] HeapTest.ShrinkVector [ OK ] HeapTest.ShrinkVector (3 ms) [ RUN ] HeapTest.MultipleMixins [63531:63531:1031/165808.166056:1406196549163:FATAL:thread_state.cc(924)] Check failed: gc_phase_ == GCPhase::kNone (2 vs. 0) #0 0x000009a1519d base::debug::StackTrace::StackTrace() #1 0x000009771daa base::debug::StackTrace::StackTrace() #2 0x0000097a2d9b logging::LogMessage::~LogMessage() #3 0x00000747f9ab blink::ThreadState::SetGCPhase() #4 0x00000747f73c blink::ThreadHeap::ObjectPayloadSizeForTesting() #5 0x0000030e5602 blink::ClearOutOldGarbage() #6 0x000003133676 blink::HeapTest_MultipleMixins_Test::TestBody() #7 0x0000035aa06e testing::internal::HandleSehExceptionsInMethodIfSupported<>() #8 0x00000359a8d2 testing::internal::HandleExceptionsInMethodIfSupported<>() #9 0x000003579d56 testing::Test::Run() #10 0x00000357a755 testing::TestInfo::Run() #11 0x00000357b4ff testing::TestCase::Run() #12 0x00000358f348 testing::internal::UnitTestImpl::RunAllTests() #13 0x0000035aa0fe testing::internal::HandleSehExceptionsInMethodIfSupported<>() #14 0x00000359c122 testing::internal::HandleExceptionsInMethodIfSupported<>() #15 0x00000358efa7 testing::UnitTest::Run() #16 0x000009a817d1 RUN_ALL_TESTS() #17 0x000009a7e7ab base::TestSuite::Run() #18 0x00000315588b runHelper() #19 0x00000330ff00 _ZN4base8internal13FunctorTraitsIPFiPNS_9TestSuiteEEvE6InvokeIS5_JS3_EEEiOT_DpOT0_ #20 0x00000330fe8d _ZN4base8internal12InvokeHelperILb0EiE8MakeItSoIPFiPNS_9TestSuiteEEJS5_EEEiOT_DpOT0_ #21 0x00000330fe55 _ZN4base8internal7InvokerINS0_9BindStateIPFiPNS_9TestSuiteEEJNS0_17UnretainedWrapperIS3_EEEEEFivEE7RunImplIS6_NSt3__15tupleIJS8_EEEJLm0EEEEiOT_OT0_NSD_16integer_sequenceImJXspT1_EEEE #22 0x0000033925d9 _ZN4base8internal7InvokerINS0_9BindStateIPFiPNS_9TestSuiteEEJNS0_17UnretainedWrapperIS3_EEEEEFivEE7RunOnceEPNS0_13BindStateBaseE #23 0x0000048431be _ZNO4base12OnceCallbackIFivEE3RunEv #24 0x000009a8b905 base::(anonymous namespace)::LaunchUnitTestsInternal() #25 0x000009a8b755 base::LaunchUnitTests() #26 0x000003155960 main #27 0x7f47be67cb97 __libc_start_main #28 0x0000030dd02a _start
,
Nov 8
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d4985fd3b6101df923d9e0f3549f008a18c67962 commit d4985fd3b6101df923d9e0f3549f008a18c67962 Author: Stephen Kyle <stephen.kyle@arm.com> Date: Thu Nov 08 16:39:16 2018 blink/heap: ensure tests find a clean GC state With this CL in place, --gtest_shuffle no longer breaks on blink_heap_unittests. BUG=899757 Change-Id: Ic1524b2c131d5629796c24bfe0d8903878540cae Reviewed-on: https://chromium-review.googlesource.com/c/1310313 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#606495} [modify] https://crrev.com/d4985fd3b6101df923d9e0f3549f008a18c67962/third_party/blink/renderer/platform/heap/heap_test.cc [modify] https://crrev.com/d4985fd3b6101df923d9e0f3549f008a18c67962/third_party/blink/renderer/platform/heap/heap_test_utilities.cc |
|
►
Sign in to add a comment |
|
Comment 1 by bugdroid1@chromium.org
, Oct 31