-
Notifications
You must be signed in to change notification settings - Fork 191
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
8304389: [11u] Crash on Windows in C2 compiled code after 8248238 and 8218431 #70
Conversation
👋 Welcome back goetz! A progress list of the required criteria for merging this PR into |
Webrevs
|
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.
It sounds like the real problem is the #ifdef _WIN64 in x86_64.ad. If that code is wrong for 64-bit Windows, shouldn't it be removed?
Hi @dean-long |
Actually, the configuration leading to errors exactly implements the calling conventions as speified here https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170#callercallee-saved-registers . The other configuration, doing more save-on-call, is always correct, but inefficient in case the registers are also saved-on-entry. In that case the registers are saved twice. This is the configuration established by this change again. |
There is probably some x64 code that is assuming Linux ABI for RSI and RDI, so it breaks when trying to use the Windows ABI. And the _WIN64 ABI settings in x86_64.ad may be effectively dead code that was never tested because of the makefile issue that never defined _WIN64 for adlc before. |
Nevermind, I think you're right, these _WIN64 ABI settings have been enabled in C2 since jdk16, so it's not clear why there is a problem only in 11u. |
@GoeLin, after more consideration, your fix does seem safest. However, it might help to have a comment explaining why that change has been disabled. So it might be better to comment out that .gmk logic rather than delete it. |
Hi @dean-long, if I comment it out, it is no more set on aarch64. By the way, as I said in the JBS issue, I think the change making the difference in 16 is "JDK-8256205: Simplify compiler calling convention handling" |
Yes, you need _WIN64 set for windows-aarch64 even if you comment out or remove the isTargetCpuBits block. My concern with just changing just the .ad file is there are other uses of #ifdef _WIN64 in x86 .hpp header files that adlc files might include directly or indirectly. To me JDK-8256205 just looks like a refactoring. I don't see how it would change the calling convention. |
Hi
adlc reads the ad file, evaluates the _WIN64, swallows it and outputs C++ files without that define. |
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.
OK, this looks reasonable. Instead of #ifdef WRONG, how about something like #ifdef DISABLED instead?
I suggest filing a separate bug/RFE to investigate the reason for the crash.
Finally, please get a 2nd review.
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.
Ok. There seems to be code which clobbers at least RSI in 11u. Having the caller preserve these registers over runtime calls looks like a feasible workaround. I think this is a good fix for the 11u release. I'd use #if 0
instead of checking for DISABLED
.
@GoeLin This change now passes all automated pre-integration checks. 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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
Hi Martin, |
/integrate |
Going to push as commit f1c92b4. |
This fix is also missing in 11u: https://bugs.openjdk.org/browse/JDK-8254252 |
… 8218431
A required fix to avoid regression in 11.0.19. See JBS issue.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u.git pull/70/head:pull/70
$ git checkout pull/70
Update a local copy of the PR:
$ git checkout pull/70
$ git pull https://git.openjdk.org/jdk11u.git pull/70/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 70
View PR using the GUI difftool:
$ git pr show -t 70
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk11u/pull/70.diff