AdjustAmountOfExternalAllocatedMemory can't be called during GC? |
|||||
Issue descriptionWhile trying to submit this: https://chromium-review.googlesource.com/c/chromium/src/+/1297067 where we use AdjustAmountOfExternalAllocatedMemory() to apply memory pressure and trigger GC. The following test: https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-zero-size-readback.html?type=cs&q=OffscreenCanvas-zero-size-readback.html&sq=package:chromium&g=0&l=1 Is failing with this stack: # Fatal error in ../../v8/src/base/platform/elapsed-timer.h, line 24 # Debug check failed: !IsStarted(). # # # #FailureMessage Object: 0x7ffdadcb0120#0 0x7f11c5ac738f base::debug::StackTrace::StackTrace() #1 0x7f11bf27424b gin::(anonymous namespace)::PrintStackTrace() #2 0x7f11b22d8098 V8_Fatal() #3 0x7f11b22d7e05 v8::base::(anonymous namespace)::DefaultDcheckHandler() #4 0x7f11be22eba2 v8::base::ElapsedTimer::Start() #5 0x7f11be6328ef v8::internal::TimedHistogram::Start() #6 0x7f11be74a529 v8::internal::Heap::CollectGarbage() #7 0x7f11be74b816 v8::internal::Heap::ReportExternalMemoryPressure() #8 0x7f11bd5f49fb blink::OffscreenCanvas::~OffscreenCanvas() #9 0x7f11bb66ad3b blink::NormalPage::Sweep() #10 0x7f11bb665ef9 blink::BaseArena::CompleteSweep() #11 0x7f11bb65d37c blink::ThreadHeap::CompleteSweep() #12 0x7f11bb6713e0 blink::ThreadState::CompleteSweep() #13 0x7f11bb67b16c blink::ThreadState::AtomicPauseSweepAndCompact() #14 0x7f11bb67aa49 blink::ThreadState::RunAtomicPause() #15 0x7f11bb6718f8 blink::ThreadState::CollectGarbage() #16 0x7f11bc865ca7 blink::V8GCController::GcEpilogue() #17 0x7f11be74cc84 v8::internal::Heap::PerformGarbageCollection() #18 0x7f11be74a664 v8::internal::Heap::CollectGarbage() #19 0x7f11be74b816 v8::internal::Heap::ReportExternalMemoryPressure() #20 0x7f11bd5f4413 blink::OffscreenCanvas::UpdateMemoryUsage() #21 0x7f11bb4f4982 blink::CanvasResourceHost::ReplaceResourceProvider() #22 0x7f11bd5f6071 blink::OffscreenCanvas::GetOrCreateResourceProvider() #23 0x7f11baa6ba00 blink::OffscreenCanvasRenderingContext2D::CanCreateCanvas2dResourceProvider() #24 0x7f11baa4bee1 blink::BaseRenderingContext2D::getImageData() As one can see, histograms explode because CollectGarbage is being called inside a destructor. What is the proper way to deal with this?
,
Oct 24
,
Oct 24
,
Oct 24
CC GC folks.
,
Oct 25
Nested GCs are supported. This is a problem w/ recursive timer scopes that are global. Assigning to memory sheriff.
,
Oct 25
The fix is in flight: https://chromium-review.googlesource.com/c/v8/v8/+/1299241
,
Oct 25
Just FYI, we also start to get a slightly different stack for the same example: [1:1:1025/141026.508906:FATAL:thread_state.cc(546)] Check failed: !IsSweepingInProgress(). #0 0x7f475061238f base::debug::StackTrace::StackTrace() #1 0x7f475053af2b logging::LogMessage::~LogMessage() #2 0x7f47461be51c blink::ThreadState::ScheduleV8FollowupGCIfNeeded() #3 0x7f47473b0a97 blink::V8GCController::GcEpilogue() #4 0x7f4749297c84 v8::internal::Heap::PerformGarbageCollection() #5 0x7f4749295664 v8::internal::Heap::CollectGarbage() #6 0x7f4749296816 v8::internal::Heap::ReportExternalMemoryPressure() #7 0x7f4747d428aa blink::ImageBitmap::~ImageBitmap() #8 0x7f47461b5d3b blink::NormalPage::Sweep() #9 0x7f47461b46ea blink::NormalPageArena::LazySweepPages() #10 0x7f47461b0909 blink::BaseArena::LazySweep() #11 0x7f47461b4bf2 blink::NormalPageArena::OutOfLineAllocate() #12 0x7f4747368182 blink::NormalPageArena::AllocateObject() #13 0x7f4747367e7d blink::ThreadHeap::AllocateOnArenaIndex() #14 0x7f4747d42ec7 blink::ImageBitmap::Create() #15 0x7f47455b6d30 blink::OffscreenCanvasRenderingContext2D::TransferToImageBitmap()
,
Oct 25
Can you file a different issue and assign it directly to me? That's a different bug and related to recursive sweeping in Oilpan.
,
Oct 25
oh. Okey. Split it to: https://crbug.com/899035
,
Oct 26
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/01d5da4beff8709abeb0b07dc9dd2254b70a1901 commit 01d5da4beff8709abeb0b07dc9dd2254b70a1901 Author: Ulan Degenbaev <ulan@chromium.org> Date: Fri Oct 26 14:17:37 2018 [heap] Make top-level GC histograms nestable. This changes the GC histograms from HistogramTimer to TimedHistogram. Bug: chromium:898613 Change-Id: Ie18c6dd3b958c3ce93f0f84faec0f306d699afa0 Reviewed-on: https://chromium-review.googlesource.com/c/1299241 Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/master@{#57036} [modify] https://crrev.com/01d5da4beff8709abeb0b07dc9dd2254b70a1901/src/counters.h [modify] https://crrev.com/01d5da4beff8709abeb0b07dc9dd2254b70a1901/src/heap/gc-tracer.cc [modify] https://crrev.com/01d5da4beff8709abeb0b07dc9dd2254b70a1901/src/heap/gc-tracer.h [modify] https://crrev.com/01d5da4beff8709abeb0b07dc9dd2254b70a1901/src/heap/heap.cc [modify] https://crrev.com/01d5da4beff8709abeb0b07dc9dd2254b70a1901/src/heap/heap.h |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by fs...@chromium.org
, Oct 24