Skip to content

Conversation

@VladimirKempik
Copy link

@VladimirKempik VladimirKempik commented May 19, 2021

Please review this patch for call_VM_Base routine.
it's expected there the LR is callee-saved register, but it's not on aarch64.
when InterpreterRuntime::throw_pending_exception is tail-call optimized,
the last subroutine before return is pthread_jit_write_protect_np which pac-sign LR.
It can only be reproduced in macos 11.4beta (just run J2Ddemo ) but in fact affects every aarch64 build.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8267235: [macos_aarch64] InterpreterRuntime::throw_pending_exception messing up LR results in crash

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4115/head:pull/4115
$ git checkout pull/4115

Update a local copy of the PR:
$ git checkout pull/4115
$ git pull https://git.openjdk.java.net/jdk pull/4115/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4115

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4115.diff

@bridgekeeper
Copy link

bridgekeeper bot commented May 19, 2021

👋 Welcome back vkempik! 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 openjdk bot added the rfr Pull request is ready for review label May 19, 2021
@openjdk
Copy link

openjdk bot commented May 19, 2021

@VladimirKempik The label aarch64-port is not a valid label. These labels are valid:

  • serviceability
  • hotspot
  • sound
  • hotspot-compiler
  • kulla
  • i18n
  • shenandoah
  • jdk
  • javadoc
  • 2d
  • security
  • swing
  • hotspot-runtime
  • jmx
  • build
  • nio
  • beans
  • core-libs
  • compiler
  • net
  • hotspot-gc
  • hotspot-jfr
  • awt

@openjdk
Copy link

openjdk bot commented May 19, 2021

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

  • hotspot

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 the hotspot hotspot-dev@openjdk.org label May 19, 2021
@openjdk
Copy link

openjdk bot commented May 19, 2021

@VladimirKempik The label aarch64-port is not a valid label. These labels are valid:

  • serviceability
  • hotspot
  • sound
  • hotspot-compiler
  • kulla
  • i18n
  • shenandoah
  • jdk
  • javadoc
  • 2d
  • security
  • swing
  • hotspot-runtime
  • jmx
  • build
  • nio
  • beans
  • core-libs
  • compiler
  • net
  • hotspot-gc
  • hotspot-jfr
  • awt

@mlbridge
Copy link

mlbridge bot commented May 19, 2021

Webrevs

@VladimirKempik
Copy link
Author

/cc hotspot-runtime

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label May 19, 2021
@openjdk
Copy link

openjdk bot commented May 19, 2021

@VladimirKempik
The hotspot-runtime label was successfully added.

Copy link
Member

@AntonKozlov AntonKozlov left a comment

Choose a reason for hiding this comment

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

The change looks good to me, but I'm not a formal reviewer.

AArch64's StubRoutines::forward_exception_entry below expects LR to point to after the runtime call. Usually LR is preserved by the runtime callee, but this is not required by the ABI [1]. So we need to restore LR after the call.

[1] https://github.com/ARM-software/abi-aa/blob/2bcab1e3b22d55170c563c3c7940134089176746/aapcs64/aapcs64.rst#general-purpose-registers

Comment on lines 684 to 686
ldr(lr, Address(rthread,
JavaThread::frame_anchor_offset()
+ JavaFrameAnchor::last_Java_pc_offset()));
Copy link
Member

Choose a reason for hiding this comment

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

ldr(lr, Address(rthread, JavaThread::last_Java_pc_offset()))? Same meaning, but shorter.

ldr(lr, Address(rthread,
JavaThread::frame_anchor_offset()
+ JavaFrameAnchor::last_Java_pc_offset()));

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this any different from adr(lr, l) ?

Copy link
Author

Choose a reason for hiding this comment

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

this gives exactly same result, thanks!

@openjdk
Copy link

openjdk bot commented May 20, 2021

@VladimirKempik 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:

8267235: [macos_aarch64] InterpreterRuntime::throw_pending_exception messing up LR results in crash

Reviewed-by: akozlov, aph

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 29 new commits pushed to the master branch:

  • b7b6acd: 8267481: Make sure table row has correct number of cells
  • f67847f: 8267396: Avoid recording "pc" in unhandled oops detector for better performance
  • 878d1b3: 8267434: Remove LinkOutput[Impl]
  • fc7f0a3: 8267480: Explicitly problemlist all runtime/os/TestTracePageSizes.java tests on linux-aarch64 to reduce noise
  • 9425d3d: 8261880: Change nested classes in java.base to static nested classes where possible
  • 459abd5: 8267219: Javadoc method summary breaks when {@inheritdoc} from an empty parent
  • aba2265: 8260267: ZGC: Reduce mark stack usage
  • f979523: 8267463: Problemlist runtime/os/TestTracePageSizes.java on linux-aarch64 to reduce noise
  • f07dcf4: 8264290: Create implementation for NSAccessibilityComponentGroup protocol peer
  • 31320c3: 8267262: com/sun/net/httpserver/Filter improve API documentation of static methods
  • ... and 19 more: https://git.openjdk.java.net/jdk/compare/1b93b81270770c208efc8c9bb10bb460636008b7...master

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 20, 2021
@VladimirKempik
Copy link
Author

/integrate

@openjdk openjdk bot closed this May 20, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 20, 2021
@openjdk
Copy link

openjdk bot commented May 20, 2021

@VladimirKempik Since your change was applied there have been 29 commits pushed to the master branch:

  • b7b6acd: 8267481: Make sure table row has correct number of cells
  • f67847f: 8267396: Avoid recording "pc" in unhandled oops detector for better performance
  • 878d1b3: 8267434: Remove LinkOutput[Impl]
  • fc7f0a3: 8267480: Explicitly problemlist all runtime/os/TestTracePageSizes.java tests on linux-aarch64 to reduce noise
  • 9425d3d: 8261880: Change nested classes in java.base to static nested classes where possible
  • 459abd5: 8267219: Javadoc method summary breaks when {@inheritdoc} from an empty parent
  • aba2265: 8260267: ZGC: Reduce mark stack usage
  • f979523: 8267463: Problemlist runtime/os/TestTracePageSizes.java on linux-aarch64 to reduce noise
  • f07dcf4: 8264290: Create implementation for NSAccessibilityComponentGroup protocol peer
  • 31320c3: 8267262: com/sun/net/httpserver/Filter improve API documentation of static methods
  • ... and 19 more: https://git.openjdk.java.net/jdk/compare/1b93b81270770c208efc8c9bb10bb460636008b7...master

Your commit was automatically rebased without conflicts.

Pushed as commit ca93399.

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

@VladimirKempik VladimirKempik deleted the JDK-8267235 branch May 20, 2021 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot hotspot-dev@openjdk.org 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