Skip to content

Commit 11ad607

Browse files
github-actions[bot]Mike McLaughlin
andauthored
Add runtime base address to Native AOT crash info JSON (#93791)
The Native AOT Watson and SOS support needs to the module's base address containing the runtime for adequate performance. Add the module base address in the crash info as "runtime_base". Changed the "runtime" to the clearer "runtime_version" property. Verified the address in local testing. Modified the !crashinfo command in SOS to display this new base address. Very low. Native AOT unhandled exception crash info. Co-authored-by: Mike McLaughlin <[email protected]>
1 parent 53d9916 commit 11ad607

File tree

1 file changed

+6
-1
lines changed
  • src/coreclr/nativeaot/System.Private.CoreLib/src/System

1 file changed

+6
-1
lines changed

src/coreclr/nativeaot/System.Private.CoreLib/src/System/CrashInfo.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,17 @@ private bool WriteHeader(RhFailFastReason reason, ulong crashingThreadId, string
103103
if (!WriteValue("version"u8, "1.0.0"u8))
104104
return false;
105105

106-
if (!WriteValue("runtime"u8, new ReadOnlySpan<byte>(RuntimeImports.RhGetRuntimeVersion(out int cbLength), cbLength)))
106+
static void Dummy() { }
107+
108+
if (!WriteHexValue("runtime_base"u8, (ulong)RuntimeImports.RhGetOSModuleFromPointer((nint)(void*)(delegate*<void>)&Dummy)))
107109
return false;
108110

109111
if (!WriteIntValue("runtime_type"u8, (int)RuntimeType.NativeAOT))
110112
return false;
111113

114+
if (!WriteValue("runtime_version"u8, new ReadOnlySpan<byte>(RuntimeImports.RhGetRuntimeVersion(out int cbLength), cbLength)))
115+
return false;
116+
112117
CrashReason crashReason = reason switch
113118
{
114119
RhFailFastReason.EnvironmentFailFast => CrashReason.EnvironmentFailFast,

0 commit comments

Comments
 (0)