From 7815be5295d8fc283ca1f29c88c3dd8a59fe998e Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Thu, 15 Oct 2026 05:51:56 +0200 Subject: [PATCH 1/2] src/common/memory_allocator: preserve 64-bit alignment masks Use the value type for the alignment mask to prevent truncation of 64-bit values on 32-bit targets. --- src/common/memory_allocator.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/memory_allocator.h b/src/common/memory_allocator.h index 5760b0c7..2d708235 100644 --- a/src/common/memory_allocator.h +++ b/src/common/memory_allocator.h @@ -76,7 +76,8 @@ class PageAllocator { template static T AlignUp(T offset, size_t alignment) { assert(alignment > 0 && ((alignment - 1) & alignment) == 0); - return (offset + (alignment - 1)) & ~(alignment - 1); + const T mask = static_cast(alignment - 1); + return (offset + mask) & ~mask; } // Allocates an array with requested amount of `bytes` and at a location with From 00b36c9d1bd849437d9912c5534c9b2c00538166 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Thu, 15 Oct 2026 06:09:21 +0200 Subject: [PATCH 2/2] src/processor/minidump_processor: preserve 64-bit exception addresses Use uint64_t instead of size_t for raw exception addresses, since size_t is only as wide as the host's address space. This avoids truncating 64-bit addresses when processing 64-bit minidumps on 32-bit hosts. --- src/processor/minidump_processor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index 00a1aa6a..b8c1066e 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -436,7 +436,7 @@ static const MDRawSystemInfo* GetSystemInfo(Minidump* dump, } static uint64_t GetAddressForArchitecture(const MDCPUArchitecture architecture, - size_t raw_address) + uint64_t raw_address) { switch (architecture) { case MD_CPU_ARCHITECTURE_X86: