v8/test/cctest/heap
Pierre Langlois 01dbc9f62b [cctest][heap] Do not rely on page limit for full space simulation.
This reverts https://chromium-review.googlesource.com/c/v8/v8/+/2372545
in favour of different solution. In order to simulate filling up a page,
it's not suitable to look at the limit() since there might be observers
that have lowered it, so the page will not actually be full.

Instead, let's relax the CHECK() in CreatePadding() to not look at the
limit() but all available space.

For instance, the test-heap/Regress978156 cctest uses FillCurrentPage()
to fill the current page. However if there's an observer on the current
page, it will not be filled entirely and the test will fail. This works
because by default, when the new space is empty, the scavenger observer
happens to be on the second page of the space. However if one changes
the V8 page size to 512k, then it fails.

This can be reproduced as such:

    # Make sure the scavenge trigger is on the first page.
    ./cctest test-heap/Regress978156  --scavenge-task-trigger=10

    # Stress marking adds random observers to trigger incremental
    # marking.
    ./cctest test-heap/Regress978156  --stress-marking=100

This issue also causes crashes when using the %SimulateNewspaceFull()
runtime test function, as found by fuzzing and you can find more details
in the bug.

Bug: v8:10808, v8:9906, chromium:1122848
Change-Id: Ie043ae0a1d3754d2423cb5d97f2b3e1ee860e5c8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2401427
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Pierre Langlois <pierre.langlois@arm.com>
Cr-Commit-Position: refs/heads/master@{#69805}
2020-09-10 12:46:50 +00:00
..
heap-tester.h [heap] Add object start bitmap for conservative stack scanning 2020-08-31 07:10:36 +00:00
heap-utils.cc [cctest][heap] Do not rely on page limit for full space simulation. 2020-09-10 12:46:50 +00:00
heap-utils.h Reland "[heap] Add concurrent typed slot recording" 2020-09-03 11:16:44 +00:00
test-alloc.cc Disable --stress-concurrent-allocation for tests that change free lists 2020-09-03 11:15:39 +00:00
test-array-buffer-tracker.cc [heap] Remove ArrayBufferTracker 2020-08-12 09:00:07 +00:00
test-compaction.cc [ptr-compr][ppc] Implement pointer compression 2020-05-06 19:06:32 +00:00
test-concurrent-allocation.cc Reland "[heap] Add concurrent typed slot recording" 2020-09-03 11:16:44 +00:00
test-concurrent-marking.cc [heap] Split marking worklist into global worklist and local worklists 2020-08-11 13:15:54 +00:00
test-embedder-tracing.cc Reland "[heap] Add concurrent typed slot recording" 2020-09-03 11:16:44 +00:00
test-external-string-tracker.cc Reland^2 "[heap] Move start of incremental marking in allocation" 2020-07-14 12:07:34 +00:00
test-heap.cc Reland "[serializer] Remove new space" 2020-09-09 15:29:16 +00:00
test-incremental-marking.cc Disable --stress-concurrent-allocation for tests that change free lists 2020-09-03 11:15:39 +00:00
test-invalidated-slots.cc Disable --stress-concurrent-allocation for tests that change free lists 2020-09-03 11:15:39 +00:00
test-iterators.cc Reland "[heap] Make ReadOnlySpace use bump pointer allocation" 2020-06-18 11:48:38 +00:00
test-lab.cc [torque] Use generated instance types, part 1 2019-10-28 18:30:31 +00:00
test-mark-compact.cc Disable --stress-concurrent-allocation for tests that change free lists 2020-09-03 11:15:39 +00:00
test-memory-measurement.cc [test] Fix UAF in cctest/test-memory-measurement/RandomizedTimeout 2020-07-10 08:52:00 +00:00
test-page-promotion.cc [heap] Remove ArrayBufferTracker 2020-08-12 09:00:07 +00:00
test-spaces.cc Disable --stress-concurrent-allocation for tests that change free lists 2020-09-03 11:15:39 +00:00
test-unmapper.cc Disable --stress-concurrent-allocation for tests that change free lists 2020-09-03 11:15:39 +00:00
test-weak-references.cc [nci] Replace CompilationTarget with a new Code::Kind value 2020-08-05 12:27:22 +00:00
test-write-barrier.cc [heap] Consolidate marking write barrier logic in MarkingBarrier 2020-07-07 10:34:37 +00:00