v8/include/cppgc/internal
Omer Katz d98b12d3df cppgc: Add missing guard for PersistentNode allocation.
Two threads might get the same PersistentNode because the
BasicCrossThreadPersistent ctor wasn't taking a lock. Then if one thread
frees the node and the other initalizes it or updates its owner, we get
some random object in our free list of PersistentNodes.

I debug a crash in Assign(Unsafe) and Clear where the PersistentNode
seemed to be allocated on stack. Empirically, adding this guard resolved
it. I can't confirm in the code that the scenario above is what was
happening.

Drive-by: adding a few DCHECKs.

Bug: chromium:1056170
Change-Id: I37d8ed5bb942a124c98d7524b7f04fe8ccb2aefd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2718144
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73023}
2021-02-24 19:12:28 +00:00
..
api-constants.h cppgc: Mark object as constructed using std::atomic::fetch_or 2020-11-11 17:30:18 +00:00
atomic-entry-flag.h cppgc: Add write barrier 2020-06-02 18:03:35 +00:00
caged-heap-local-data.h cppgc: Avoid dispatching write barrier during atomic pause 2021-02-08 12:56:09 +00:00
compiler-specific.h cppgc: Add initial implementation of young generation 2020-06-17 06:48:10 +00:00
finalizer-trait.h cppgc: Add public target to build against 2020-04-21 12:48:23 +00:00
gc-info.h cppgc: Add naming infrastructure 2020-10-08 12:25:21 +00:00
logging.h Fix LINT exceptions across the code base 2020-04-27 16:37:04 +00:00
name-trait.h cppgc: Fix compile-time typename for release builds 2020-10-09 09:33:02 +00:00
persistent-node.h cppgc: Add missing guard for PersistentNode allocation. 2021-02-24 19:12:28 +00:00
pointer-policies.h cppgc: Fix low-level write barriers 2021-02-05 15:22:04 +00:00
prefinalizer-handler.h cppgc: Typo and signature fix 2020-09-02 07:34:20 +00:00
write-barrier.h cppgc: Implement process-global state accessors. 2021-02-17 22:37:24 +00:00