Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

Add context argument to PalCreateCrashDumpIfEnabled and PROCCreateCrashDumpIfEnabled methods

This PR addresses the issue where the context pointer is missing in crash dumps, making diagnosis difficult.

Contributes to #119761

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 19, 2025
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot AI changed the title [WIP] Add context argument to crash dump methods Add context argument to crash dump functions to preserve register state Nov 19, 2025
Copilot AI requested a review from jkotas November 19, 2025 04:19
Copilot finished work on behalf of jkotas November 19, 2025 04:19
Instead of using a volatile variable, create a helper function marked with
noinline and no-optimization attributes that accepts the address of the
context pointer. This ensures the context is properly preserved in crash
dumps and not optimized away by the compiler.

Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot AI requested a review from jkotas November 19, 2025 06:27
Copilot finished work on behalf of jkotas November 19, 2025 06:27
Updated PROCAbort to accept a context parameter and modified all call sites
in signal handlers to pass the context pointer where it is available. This
ensures context information is preserved in crash dumps when aborting.

Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot finished work on behalf of jkotas November 19, 2025 07:02
Renamed the helper function to DoNotOptimize with a const void* parameter
to make it more general-purpose and not specific to context pointers.

Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot AI requested a review from jkotas November 19, 2025 07:44
Copilot finished work on behalf of jkotas November 19, 2025 07:44
@jkotas jkotas added area-PAL-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Nov 19, 2025
@jkotas jkotas marked this pull request as ready for review November 19, 2025 08:32
@jkotas jkotas requested review from Copilot and removed request for MichalStrehovsky and Copilot November 19, 2025 08:32
@jkotas jkotas merged commit f62405c into main Nov 19, 2025
107 of 109 checks passed
@akoeplinger akoeplinger deleted the copilot/add-context-argument-crash-dump branch November 21, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants