RFR: 8348862: runtime/ErrorHandling/CreateCoredumpOnCrash fails on Windows aarch64 [v5]

Monica Beckwith mbeckwit at openjdk.org
Thu Oct 9 19:23:18 UTC 2025


On Tue, 7 Oct 2025 17:05:04 GMT, Saint Wesonga <duke at openjdk.org> wrote:

>> The Windows AArch64 OpenJDK build uses vectored exception handling. The implementation registers a custom vectored exception handler, which calls the exception filter function that is shared with the x64 platform. However, this call only happens when using -xcomp. This has the side effect of not running the JVM error handling code that would create a core dump if only the interpreter is used. This change fixes this issue by unconditionally using the same exception handler as Windows x64. The CreateCoredumpOnCrash test now passes with this change.
>> 
>> Although vectored exception handling is used on Windows AArch64, the implementation currently uses the same safefetch implementation as x64, which relies on structured exception handling. This change fixes safefetch on Windows AArch64 to not use the SEH implemenation (in safefetch_windows.hpp). This change defines the static assembly language for the fetching code like the other aarch64 platforms have done and updates the exception handler to recognize exceptions from the safe fetch assembly instructions. This came up because the NMT gtests started failing after the change to the exception handler.
>> 
>> Exceptions with exception codes that are success HRESULT values are also encountered in routine execution on Windows AArch64. One example of an error code for which error reporting should not be done is an exception with the DBG_PRINTEXCEPTION_C  exception code, which is encountered in routine execution on Windows AArch64. Such exceptions are excluded from error reporting, similar to how EXCEPTION_BREAKPOINT is excluded. The codes for which error reporting will be performed are those for which the Windows FAILED macro returns true. See [Error Codes in COM
>> ](https://learn.microsoft.com/en-us/windows/win32/learnwin32/error-codes-in-com) for more information on COM error handling.
>
> Saint Wesonga has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add missing fix for UncaughtNativeExceptionTest

LGTM - Thanks for fixing this @swesonga 

Reviewed the Windows aarch64 exception handling implementation:

- FAILED() macro usage correct for vectored exception handling
- SafeFetch integration properly handles fault/continuation pattern
- Test update with 0xdeadbeef appropriately validates the filtering logic
- Clean platform-specific conditional compilation

Good fix for the crash handling issues.

-------------

Marked as reviewed by mbeckwit (Author).

PR Review: https://git.openjdk.org/jdk/pull/27074#pullrequestreview-3320338147


More information about the hotspot-runtime-dev mailing list