JDK-8262896 : [macos_aarch64] Crash in jni_fast_GetLongField
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: aarch64
  • Submitted: 2021-03-02
  • Updated: 2023-01-11
  • Resolved: 2021-04-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 16 JDK 17
11.0.15Fixed 16-poolResolved 17 b18Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
Testing https://github.com/openjdk/jdk/pull/2200 reveals this crash in java/util/logging/TestLoggerWeakRefLeak.java:

Test for WeakReference leak in Logger object
call count = 1000
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0x0000000111d0c400, pid=27992, tid=23043
#
# JRE version: Java(TM) SE Runtime Environment (17.0) (build 17-internal+0-LTS-2021-02-27-1954067.mikael.vidstedt.jdk-macosjib)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (17-internal+0-LTS-2021-02-27-1954067.mikael.vidstedt.jdk-macosjib, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# v  ~BufferBlob::jni_fast_GetLongField
#
# Core dump will be written. Default location: core.27992
#

instance count: 1002
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Comments
A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk11u-dev/pull/715 Date: 2021-12-13 20:11:31 +0000
18-12-2021

Changeset: 283d64f8 Author: Anton Kozlov <akozlov@openjdk.org> Committer: David Holmes <dholmes@openjdk.org> Date: 2021-04-13 22:34:28 +0000 URL: https://git.openjdk.java.net/jdk/commit/283d64f8
13-04-2021

Also spotted in com/sun/jdi/SourceNameFilterTest.java but I'm guessing this is a race condition of sorts and can happen in pretty much any test.
07-04-2021

The issue is caused by missing W->X transition in Perf_Detach
12-03-2021

Interesting, thanks! The root cause looks clear, but I cannot reproduce the issue, probably it needs to run in some specific batch. I need some time to get a stable reproducer to very any possible fix. I'm thinking about adding more code to target this specific issue. The problem is that a JNI interface function is called from the libjvm.so, but the function is substituted with an optimized generated version. We miss a W^X transition in this case. For robustness, we need a W^X transition on the callee side, so the jni_fast_xxx generator needs to be changed.
12-03-2021

This will be be fixed as part of the macOS-Aarch64 port, so assigning to Anton.
10-03-2021