Skip to content

In-proc crash reporter asserts when resolving IL offset for framed P/Invoke transition #131517

Description

@mdh1418

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1530978
Build error leg or test failing: baseservices/exceptions/unhandled/unhandledTester/unhandledTester.cmd
Pull request: #131520

Error Message

The in-process crash reporter can assert in Checked builds while walking a framed managed-to-native transition.

A native failure during P/Invoke can produce a CrawlFrame where:

  • CrawlFrame::GetFunction() returns the managed P/Invoke MethodDesc.
  • The instruction pointer is inside the native function.
  • The frame is not frameless.

The reporter passes this mismatched MethodDesc and instruction pointer to GetILOffsetFromNative, triggering:

ASSERT FAILED
Expression: g_pEEInterface->GetNativeCodeMethodDesc(startAddr) == fd
Location: src/coreclr/debug/ee/functioninfo.cpp:1554
Function: FindOrCreateInitAndAddJitInfo

Observed in local testing on macOS + macOS baseservices-exceptions test

The test's  foreign  unhandled-exception scenario inherits  DOTNET_EnableCrashReport=1 . Enabling the in-process reporter on macOS causes it to walk the P/Invoke transition frame and hit the assertion.

The assertion changes the process exit code from the expected  SIGABRT  ( 134 ) to  SIGTRAP  ( 133 ), failing  unhandledTester .

Expected behavior

Crash reporting should remain best-effort and must not alter the process's expected fatal-signal termination.

For framed or faulted frames, the reporter should retain available method, module, and token information but leave native and IL offsets unknown.

Known Issue Error Message

DO NOT USE JSON BELOW IF THIS IS A BUILD BREAK otherwise build analysis will allow pull requests to merge that break the build worse. For a build break, do not use this issue form. Make a regular new issue.

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "System.Exception: Wrong exit code: 0x00000085, expected 0x00000086",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1530978
Error message validated: [System.Exception: Wrong exit code: 0x00000085, expected 0x00000086]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 7/29/2026 2:10:47 PM UTC

Report

Build Repository Test Pull Request
1531563 dotnet/runtime baseservices/exceptions/unhandled/unhandledTester/unhandledTester.cmd #130313
1531496 dotnet/runtime baseservices/exceptions/unhandled/unhandledTester/unhandledTester.cmd #131531
1531493 dotnet/runtime baseservices/exceptions/unhandled/unhandledTester/unhandledTester.cmd #131532
1531410 dotnet/runtime baseservices/exceptions/unhandled/unhandledTester/unhandledTester.cmd #129634
1531395 dotnet/runtime baseservices/exceptions/unhandled/unhandledTester/unhandledTester.cmd #131526
1531411 dotnet/runtime baseservices/exceptions/unhandled/unhandledTester/unhandledTester.cmd
1531418 dotnet/runtime baseservices/exceptions/unhandled/unhandledTester/unhandledTester.cmd #131307
1530978 dotnet/runtime baseservices/exceptions/unhandled/unhandledTester/unhandledTester.cmd #131520
1530915 dotnet/runtime baseservices/exceptions/unhandled/unhandledTester/unhandledTester.cmd

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
9 9 9

Metadata

Metadata

Assignees

Labels

Known Build ErrorUse this to report build issues in the .NET Helix tabarea-Diagnostics-coreclrblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'

Type

No type

Projects

Status
No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions