Add alignas(T) to HeapVectorBacking to preserve element alignment [chromium/src : main]

0 views
Skip to first unread message

Keishi Hattori (Gerrit)

unread,
Aug 4, 2026, 2:45:11 AM (6 days ago) Aug 4
to Michael Lippautz, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, chromium...@chromium.org, Kentaro Hara, blink-...@chromium.org, kinuko...@chromium.org, kouhe...@chromium.org, oilpan-rev...@chromium.org
Attention needed from Michael Lippautz

Keishi Hattori added 1 comment

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Keishi Hattori . resolved

PTAL. This CL serves as the immediate fix for libc++ hardening aborts triggered by nested vectors (e.g., HeapVector<HeapVector<...>>) on 32-bit DCHECK builds.

Root Cause:
In DCHECK builds, VectorBufferBase previously used an int64_t for modifications_, artificially boosting alignof(HeapVector) to 8 bytes on 32-bit systems. Oilpan's backing store wrapper (HeapVectorBacking<T>) did not inherit element alignment, resulting in 4-byte aligned backing heap allocations. Casting a 4-byte aligned backing buffer to an 8-byte aligned inner HeapVector pointer triggered fatal memory alignment aborts.

I landed an immediate fix by changing the counter type(https://crrev.com/c/8176251) but I thought we should fix this too.

Open in Gerrit

Related details

Attention is currently required from:
  • Michael Lippautz
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I156c836bd1e3750168a5e947cc02da6bb2ea85de
Gerrit-Change-Number: 8179109
Gerrit-PatchSet: 6
Gerrit-Owner: Keishi Hattori <kei...@chromium.org>
Gerrit-Reviewer: Keishi Hattori <kei...@chromium.org>
Gerrit-Reviewer: Michael Lippautz <mlip...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-Attention: Michael Lippautz <mlip...@chromium.org>
Gerrit-Comment-Date: Tue, 04 Aug 2026 06:45:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages