Skip to content

8348862: runtime/ErrorHandling/CreateCoredumpOnCrash fails on Windows aarch64#27074

Closed
swesonga wants to merge 8 commits intoopenjdk:masterfrom
swesonga:8348862-create-core-dumps-win-aarch64
Closed

8348862: runtime/ErrorHandling/CreateCoredumpOnCrash fails on Windows aarch64#27074
swesonga wants to merge 8 commits intoopenjdk:masterfrom
swesonga:8348862-create-core-dumps-win-aarch64

Conversation

@swesonga
Copy link
Member

@swesonga swesonga commented Sep 3, 2025

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
for more information on COM error handling.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8348862: runtime/ErrorHandling/CreateCoredumpOnCrash fails on Windows aarch64 (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27074/head:pull/27074
$ git checkout pull/27074

Update a local copy of the PR:
$ git checkout pull/27074
$ git pull https://git.openjdk.org/jdk.git pull/27074/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27074

View PR using the GUI difftool:
$ git pr show -t 27074

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27074.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 3, 2025

👋 Welcome back swesonga! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 3, 2025

@swesonga This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8348862: runtime/ErrorHandling/CreateCoredumpOnCrash fails on Windows aarch64

Reviewed-by: dholmes, mbeckwit

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 53 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@dholmes-ora) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk
Copy link

openjdk bot commented Sep 3, 2025

@swesonga The following label will be automatically applied to this pull request:

  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added hotspot-runtime hotspot-runtime-dev@openjdk.org rfr Pull request is ready for review labels Sep 3, 2025
@mlbridge
Copy link

mlbridge bot commented Sep 3, 2025

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of comments on the shared Windows code - I can't review the actual changes here.

Thanks

Comment on lines +2667 to +2670
#elif defined(_M_ARM64)
if (handle_safefetch(exception_code, pc, (void*)exceptionInfo->ContextRecord)) {
return EXCEPTION_CONTINUE_EXECUTION;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you merge with the existing ARM64 section so we only have two distinct code chunks: one for X64 and one for aarch64. Thanks

swesonga and others added 2 commits September 4, 2025 09:06
Co-authored-by: David Holmes <62092539+dholmes-ora@users.noreply.github.com>
Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions for os_windows.cpp:

  • Merge the AMD64 block at line 2658 with the one at 2651.
  • Move line 2656 Thread* t = ... to line 2680 as t seems not used until line 2681

Thanks

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing further from me. Ideally one of the other Windows-aarch64 port developers would also review this.

Thanks

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 8, 2025
Copy link
Contributor

@mo-beck mo-beck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@swesonga
Copy link
Member Author

swesonga commented Oct 9, 2025

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Oct 9, 2025
@openjdk
Copy link

openjdk bot commented Oct 9, 2025

@swesonga
Your change (at version 9faaa85) is now ready to be sponsored by a Committer.

@dholmes-ora
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Oct 10, 2025

Going to push as commit f4209df.
Since your change was applied there have been 60 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 10, 2025
@openjdk openjdk bot closed this Oct 10, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Oct 10, 2025
@openjdk
Copy link

openjdk bot commented Oct 10, 2025

@dholmes-ora @swesonga Pushed as commit f4209df.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants