Skip to content

Commit fe8b347

Browse files
authored
Fix assertion when capturing dump on ARM64 (#112550)
1 parent 79eed94 commit fe8b347

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/coreclr/debug/createdump/memoryregion.h

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
#include "specialdiaginfo.h"
5+
46
#if !defined(PAGE_SIZE) && (defined(__arm__) || defined(__aarch64__) || defined(__loongarch64)) || defined(__riscv)
57
extern long g_pageSize;
68
#define PAGE_SIZE g_pageSize
@@ -44,8 +46,15 @@ struct MemoryRegion
4446
m_endAddress(end),
4547
m_offset(0)
4648
{
47-
assert((start & ~PAGE_MASK) == 0);
48-
assert((end & ~PAGE_MASK) == 0);
49+
if (start == SpecialDiagInfoAddress)
50+
{
51+
assert(end == (SpecialDiagInfoAddress + SpecialDiagInfoSize));
52+
}
53+
else
54+
{
55+
assert((start & ~PAGE_MASK) == 0);
56+
assert((end & ~PAGE_MASK) == 0);
57+
}
4958
}
5059

5160
// copy with new flags constructor. The file name is not copied.

src/coreclr/debug/createdump/specialdiaginfo.h

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// information like the exception record address for a NativeAOT app crash or the runtime module
1212
// base address. The exception record contains the pointer to the JSON formatted crash info.
1313

14+
#pragma once
15+
1416
#define SPECIAL_DIAGINFO_SIGNATURE "DIAGINFOHEADER"
1517
#define SPECIAL_DIAGINFO_VERSION 2
1618

0 commit comments

Comments
 (0)