From bad31df2f7b64c7b053ea8eb70c6d89f1998826c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 08:44:27 -0700 Subject: [PATCH] Fix createdump 'stack smashing detected' error on arm64 (#108208) The changes from PR #91865 were reverted by PR #95433. This change restores the fix from PR #91865 by changing the size back to SpecialDiagInfoSize but uses the 4 parameter MemoryRegion constructor that doesn't assert the address/size is on a PAGE_SIZE alignment (PR #95433). Issue: https://github.com/dotnet/runtime/issues/108023 Co-authored-by: Mike McLaughlin Co-authored-by: Jeff Schwartz --- src/coreclr/debug/createdump/crashinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/debug/createdump/crashinfo.cpp b/src/coreclr/debug/createdump/crashinfo.cpp index 32a372d373862..4026903f289e0 100644 --- a/src/coreclr/debug/createdump/crashinfo.cpp +++ b/src/coreclr/debug/createdump/crashinfo.cpp @@ -199,8 +199,8 @@ CrashInfo::GatherCrashInfo(DumpType dumpType) { return false; } - // Add the special (fake) memory region for the special diagnostics info - MemoryRegion special(PF_R, SpecialDiagInfoAddress, SpecialDiagInfoAddress + PAGE_SIZE); + // Add the special (fake) memory region for the special diagnostics info. Use constructor that doesn't assert PAGE_SIZE alignment. + MemoryRegion special(PF_R, SpecialDiagInfoAddress, SpecialDiagInfoAddress + SpecialDiagInfoSize, /* offset */ 0); m_memoryRegions.insert(special); #ifdef __APPLE__ InitializeOtherMappings();