JDK-8265292 : [macos_aarch64] java/foreign/TestDowncall.java crashes with SIGBUS
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: aarch64
  • Submitted: 2021-04-15
  • Updated: 2022-06-01
  • Resolved: 2021-05-18
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 17
17 b23Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8265293 :  
Description
...
test TestDowncall.testDowncall("f12_F_FIS_DII", NON_VOID, [FLOAT, INT, STRUCT], [DOUBLE, INT, INT]): success
test TestDowncall.testDowncall("f12_F_FIS_DIF", NON_VOID, [FLOAT, INT, STRUCT], [DOUBLE, INT, FLOAT]): success
test TestDowncall.testDowncall("f12_F_FIS_DID", NON_VOID, [FLOAT, INT, STRUCT], [DOUBLE, INT, DOUBLE]): success
test TestDowncall.testDowncall("f12_F_FIS_DIP", NON_VOID, [FLOAT, INT, STRUCT], [DOUBLE, INT, POINTER]): success
test TestDowncall.testDowncall("f12_F_FIS_DFI", NON_VOID, [FLOAT, INT, STRUCT], [DOUBLE, FLOAT, INT]): success
test TestDowncall.testDowncall("f12_F_FIS_DFF", NON_VOID, [FLOAT, INT, STRUCT], [DOUBLE, FLOAT, FLOAT]): success
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0x00000001090c1060, pid=15770, tid=24835
#
# JRE version: Java(TM) SE Runtime Environment (17.0+19) (build 17-ea+19-LTS-1515)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (17-ea+19-LTS-1515, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# V  [libjvm.dylib+0x8c1060]  _ZN21MarkActivationClosure12do_code_blobEP8CodeBlob+0x3c
#
# Core dump will be written. Default location: core.15770



Stack: [0x000000016e188000,0x000000016e38b000],  sp=0x000000016e387d40,  free space=2047k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x8c1060]  _ZN21MarkActivationClosure12do_code_blobEP8CodeBlob+0x3c
V  [libjvm.dylib+0x8fea78]  _ZN10JavaThread11nmethods_doEP15CodeBlobClosure+0x84
V  [libjvm.dylib+0x401100]  _ZN14HandshakeState18process_self_innerEv+0x18c
V  [libjvm.dylib+0x400f60]  _ZN14HandshakeState15process_by_selfEv+0x48
V  [libjvm.dylib+0x832690]  _ZN18SafepointMechanism25process_if_requested_slowEP10JavaThread+0x54
V  [libjvm.dylib+0x8fe4b8]  _ZN10JavaThread44check_safepoint_and_suspend_for_native_transEPS_+0x24
V  [libjvm.dylib+0x92395c]  _ZN19ProgrammableInvoker13invoke_nativeEPFvPhES0_P10JavaThread+0x118
V  [libjvm.dylib+0x923aa8]  PI_invokeNative+0x104
J 2565  jdk.internal.foreign.abi.ProgrammableInvoker.invokeNative(JJ)V jdk.incubator.foreign@17-ea (0 bytes) @ 0x00000001189eeed0 [0x00000001189eee40+0x0000000000000090]
C  0x00000007ea5e5808
Comments
Changeset: b92c5a44 Author: Anton Kozlov <akozlov@openjdk.org> Date: 2021-05-18 18:54:16 +0000 URL: https://git.openjdk.java.net/jdk/commit/b92c5a44f268c3a866fa6bc6f6218abc0457e689
18-05-2021

The fix is indeed simple (swaps two lines ProgrammableInvoker::invoke_native), but I stuck with reproducing the issue. It looks like we need an assert around possible nmethods marking or even safepoint. But if you're confident with the fix, I can assign this to you, Andrew.
06-05-2021

Anton, are you working on this? It's blocking tests and the fix is pretty obvious.
05-05-2021

ILW = HLM = P3
20-04-2021

... and then discovered core dumps were disabled... Argh.
15-04-2021

Thanks. I reproduced after about an hour.
15-04-2021

I have run hundreds of tier1 jobs and this only happened once, so it seems very intermittent.
15-04-2021

I'm seeing no fails. How long do you have to run it for?
15-04-2021