V8 10.8: Static asserts on Windows x86 build

33 views
Skip to first unread message

ClearScript Developers

unread,
Nov 29, 2022, 11:35:44 AM11/29/22
to v8-dev
Folks,

We're hitting the following in Windows x86 builds of 10.8:

./../..\src/heap/spaces.h(344,35): note: expression evaluates to '152 <= 148'
static_assert(sizeof(MemoryChunk) <= MemoryChunk::kHeaderSize);

Anyone else?

dinf...@chromium.org

unread,
Nov 30, 2022, 3:34:19 AM11/30/22
to v8-dev
Hi,

We recently looked into such an issue. This was caused by std::bitset (used by MemoryChunk::active_system_pages_) having different sizes in clang vs msvc. Are you using msvc by chance?

Cheers,
Dominik

ClearScript Developers

unread,
Nov 30, 2022, 8:34:36 AM11/30/22
to v8-dev
Hi Dominik,

Thanks for your reply. Here's our GN config:

enable_precompiled_headers = false
fatal_linker_warnings = false
is_component_build = false
is_debug = false
target_cpu = "x86"
use_custom_libcxx = false
use_thin_lto = false
v8_enable_pointer_compression = false
v8_enable_31bit_smis_on_64bit_arch = false
v8_monolithic = true
v8_target_cpu = "x86"
v8_use_external_startup_data = false

Thanks!

ClearScript Developers

unread,
Nov 30, 2022, 9:53:32 AM11/30/22
to v8-dev
We added the following:

static_assert(offsetof(MemoryChunk, was_used_for_allocation_) == MemoryChunkLayout::kWasUsedForAllocationOffset);
static_assert(sizeof(MemoryChunk) == MemoryChunkLayout::kWasUsedForAllocationOffset + sizeof(size_t));

The second assert fails, as if MemoryChunk had an extra field or was padded out to an 8-byte boundary. Probably the latter?
Reply all
Reply to author
Forward
0 new messages