-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8344802: Crash in StubRoutines::verify_mxcsr with -XX:+EnableX86ECoreOpts and -Xcheck:jni #22673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 Welcome back vpaprotski! A progress list of the required criteria for merging this PR into |
|
@vpaprotsk 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: 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 706 new commits pushed to the
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 (@sviswa7, @TheShermanTanker, @vnkozlov) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
@vpaprotsk The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
|
@vpaprotsk This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
(back from vacation. After discussing this with Sandhya, will have an update soon) |
| if (EnableX86ECoreOpts) { | ||
| // On ECore, restore with signaling flags enabled | ||
| MxCsr |= 0x3F; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JornVernee I came across your comment https://github.com/openjdk/jdk/pull/14523/files#r1236920072
I believe I am following the 'spirit' of that comment here, but would appreciate you having a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think so. Originally I was seeing some cases where we were always resetting MxCsr, even for unrelated exceptions. The new code still only resets it for the FLT_* exceptions.
|
|
||
| stmxcsr(mxcsr_save); | ||
| movl(tmp, mxcsr_save); | ||
| // Mask out any pending exceptions (only check control and mask bits) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should go on the else path and could be changed to "Mask out status bits (only check control and mask bits)"
| // On Ecore, status bits are set by default (for performance) | ||
| orl(tmp, 0x003f); // On Ecore, exception bits are set by default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplication in comment. Comment could be modified to reflect something like "The mxcsr_std has status bits set for performance on ECore"
| // | ||
| jint MxCsr = INITIAL_MXCSR; // set to 0x1f80` in winnt.h | ||
| if (EnableX86ECoreOpts) { | ||
| // On ECore, restore with signaling flags enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change comment to // On ECore restore with status bits enabled.
sviswa7
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
|
(deleted integrate command) |
|
@vpaprotsk |
| } | ||
|
|
||
| #if defined(_M_AMD64) | ||
| extern bool handle_FLT_exception(struct _EXCEPTION_POINTERS* exceptionInfo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems strange to declare inside another method like this, not a showstopper but it might be better to declare it where handle_FLT_exception used to be defined in this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh.. I remember wondering where to put this. Meant to come back and find the right header.
I couldn't find the right header 'easily' and leaving it where the old function was looked even more out of place (i.e. "things like this belong in headers"?). So this was my alternative...
TheShermanTanker
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good otherwise
Co-authored-by: Julian Waters <32636402+TheShermanTanker@users.noreply.github.com>
vnkozlov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I submitted our internal testing. Please wait results.
Thanks! Deleted the integrate command |
vnkozlov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My tier1-4, stress, xcomp testing passed.
|
Thanks! /integrate |
|
@vpaprotsk |
|
/sponsor |
|
Going to push as commit 55097dd.
Your commit was automatically rebased without conflicts. |
|
@sviswa7 @vpaprotsk Pushed as commit 55097dd. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
(Also see
8319429: Resetting MXCSR flags degrades ecore)This PR fixes two issues:
__ warncorrupting the stack on Windows onlyFirst, the crash. Caused when FXRSTOR is attempting to write reserved bits into MXCSR. If those bits happen to be set, crash. (Hence the crash isn't deterministic. But frequent enough if

__ warnis used). It is caused by the binding not reserving stack space for register parameters ()Prolog of the warn function then proceeds to store the for arg registers onto the stack, overriding the fxstore save area. (See https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170#calling-convention-defaults)
Fix uses
frame::arg_reg_save_area_bytesto bump the stack pointer.I also kept the fix to
verify_mxcsrsince without it,-Xcheck:jniis practically unusable when-XX:+EnableX86ECoreOptsare set (65k+ lines of warnings)Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22673/head:pull/22673$ git checkout pull/22673Update a local copy of the PR:
$ git checkout pull/22673$ git pull https://git.openjdk.org/jdk.git pull/22673/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22673View PR using the GUI difftool:
$ git pr show -t 22673Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22673.diff
Using Webrev
Link to Webrev Comment