RFR: 8265292: [macos_aarch64] java/foreign/TestDowncall.java crashes with SIGBUS [v2]

Anton Kozlov akozlov at openjdk.java.net
Tue May 11 15:09:25 UTC 2021


> Please review a fix for the intermittent crash. It is caused by a mistake in the ProgrammableInvoker::invoke_native, the wrong order of W^X and JavaThread state transition. We need WXExec since we are about to call a generated stub. But we need to switch to WXExec only after JavaThread state change. The thread state change may trigger a safepoint, that would need to do bookkeeping in the codecache (MarkActivationClosure::do_code_blob from the bug). So the fix is to change JavaThread state first, then change WX.
> 
> The fix was verified with the help of https://bugs.openjdk.java.net/browse/JDK-8266742. The new check catches all test failures reported by 8265292, 8265183, 8265182. I've verified tests pass after the fix with that new check enabled.

Anton Kozlov has updated the pull request incrementally with one additional commit since the last revision:

  Add comments

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3921/files
  - new: https://git.openjdk.java.net/jdk/pull/3921/files/cb9723b7..d46cd678

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3921&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3921&range=00-01

  Stats: 11 lines in 2 files changed: 11 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3921.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3921/head:pull/3921

PR: https://git.openjdk.java.net/jdk/pull/3921


More information about the hotspot-dev mailing list