Skip to content

Commit

Permalink
Add runtime base address to Native AOT crash info JSON (#93791)
Browse files Browse the repository at this point in the history
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 <mikem@microsoft.com>
  • Loading branch information
github-actions[bot] and mikem8361 authored Oct 20, 2023
1 parent 53d9916 commit 11ad607
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,17 @@ private bool WriteHeader(RhFailFastReason reason, ulong crashingThreadId, string
if (!WriteValue("version"u8, "1.0.0"u8))
return false;

if (!WriteValue("runtime"u8, new ReadOnlySpan<byte>(RuntimeImports.RhGetRuntimeVersion(out int cbLength), cbLength)))
static void Dummy() { }

if (!WriteHexValue("runtime_base"u8, (ulong)RuntimeImports.RhGetOSModuleFromPointer((nint)(void*)(delegate*<void>)&Dummy)))
return false;

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

if (!WriteValue("runtime_version"u8, new ReadOnlySpan<byte>(RuntimeImports.RhGetRuntimeVersion(out int cbLength), cbLength)))
return false;

CrashReason crashReason = reason switch
{
RhFailFastReason.EnvironmentFailFast => CrashReason.EnvironmentFailFast,
Expand Down

0 comments on commit 11ad607

Please sign in to comment.