JDK-8255479 : AArch64: assert(src->section_index_of(target) == CodeBuffer::SECT_NONE) failed: sanity
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: openjdk8u292,11,16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: aarch64
  • Submitted: 2020-10-27
  • Updated: 2024-12-20
  • Resolved: 2020-11-24
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
11.0.11-oracleFixed 16 b26Fixed
Description
The following test failed in the JDK16 CI:

compiler/unsafe/GetUnsafeObjectG1PreBarrier.java

Here's a snippet from the log file:

#section:main
----------messages:(5/522)----------
command: main -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32 compiler.unsafe.GetUnsafeObjectG1PreBarrier
reason: User specified action: run main/othervm -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:ObjectAlignmentInBytes=32 compiler.unsafe.GetUnsafeObjectG1PreBarrier 
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules java.base --add-exports java.base/jdk.internal.misc=ALL-UNNAMED --add-opens java.base/jdk.internal.misc=ALL-UNNAMED
elapsed time (seconds): 16.63
----------configuration:(5/166)----------
Boot Layer
  add modules: java.base                   
  add exports: java.base/jdk.internal.misc ALL-UNNAMED
  add opens:   java.base/jdk.internal.misc ALL-UNNAMED

----------System.out:(35/2985)----------
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/relocInfo.cpp:743
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/47535081-0322-4d83-bb78-f7e11abb86d0-S27761/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/dd890e86-a602-44d6-80fb-77f3d5019bc4/runs/7fa4f459-8737-47f5-af3a-8d34ffef2b96/workspace/open/src/hotspot/share/code/relocInfo.cpp:743), pid=16914, tid=16928
#  assert(src->section_index_of(target) == CodeBuffer::SECT_NONE) failed: sanity
#
# JRE version: Java(TM) SE Runtime Environment (16.0+22) (fastdebug build 16-ea+22-1303)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 16-ea+22-1303, mixed mode, compressed oops, g1 gc, linux-aarch64)
# Problematic frame:
# V  [libjvm.so+0x146fe30]  external_word_Relocation::fix_relocation_after_move(CodeBuffer const*, CodeBuffer*)+0xd0
#
# Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /scratch/opt/mach5/mesos/work_dir/slaves/4076d11c-c6ed-4d07-84c1-4ab8d55cd975-S106750/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/2a27a30e-2d9b-4f6a-b21c-7fb53619ab9d/runs/ecc0f938-a9a9-4963-bd1d-2941a36ab231/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_3/scratch/2/core.16914)
#
# An error report file with more information is saved as:
# /scratch/opt/mach5/mesos/work_dir/slaves/4076d11c-c6ed-4d07-84c1-4ab8d55cd975-S106750/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/2a27a30e-2d9b-4f6a-b21c-7fb53619ab9d/runs/ecc0f938-a9a9-4963-bd1d-2941a36ab231/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_3/scratch/2/hs_err_pid16914.log
Compiled method (c2)    1269  145   !         java.util.concurrent.ConcurrentHashMap::putVal (432 bytes)
 total in heap  [0x0000fffe51a3c290,0x0000fffe51a3e678] = 9192
 relocation     [0x0000fffe51a3c3f8,0x0000fffe51a3c528] = 304
 main code      [0x0000fffe51a3c540,0x0000fffe51a3d4c0] = 3968
 stub code      [0x0000fffe51a3d4c0,0x0000fffe51a3d650] = 400
 metadata       [0x0000fffe51a3d650,0x0000fffe51a3d6a8] = 88
 scopes data    [0x0000fffe51a3d6a8,0x0000fffe51a3dca0] = 1528
 scopes pcs     [0x0000fffe51a3dca0,0x0000fffe51a3e5a0] = 2304
 dependencies   [0x0000fffe51a3e5a0,0x0000fffe51a3e5a8] = 8
 handler table  [0x0000fffe51a3e5a8,0x0000fffe51a3e668] = 192
 nul chk table  [0x0000fffe51a3e668,0x0000fffe51a3e678] = 16
#
# Compiler replay data is saved as:
# /scratch/opt/mach5/mesos/work_dir/slaves/4076d11c-c6ed-4d07-84c1-4ab8d55cd975-S106750/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/2a27a30e-2d9b-4f6a-b21c-7fb53619ab9d/runs/ecc0f938-a9a9-4963-bd1d-2941a36ab231/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_compiler_3/scratch/2/replay_pid16914.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#
----------System.err:(0/0)----------

Here's the crashing thread's stack:

---------------  T H R E A D  ---------------

Current thread (0x0000fffe5c4b4ac0):  JavaThread "C2 CompilerThread0" daemon [_thread_in_vm, id=16928, stack(0x0000fffe3dfe0000,0x0000fffe3e1e0000)]


Current CompileTask:
C2:   1258  145   !b        java.util.concurrent.ConcurrentHashMap::putVal (432 bytes)

Stack: [0x0000fffe3dfe0000,0x0000fffe3e1e0000],  sp=0x0000fffe3e1da700,  free space=2025k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x146fe30]  external_word_Relocation::fix_relocation_after_move(CodeBuffer const*, CodeBuffer*)+0xd0
V  [libjvm.so+0x9174e8]  CodeBuffer::relocate_code_to(CodeBuffer*) const+0x474
V  [libjvm.so+0x919bd0]  CodeBuffer::copy_code_to(CodeBlob*)+0x90
V  [libjvm.so+0x12bde78]  nmethod::nmethod(Method*, CompilerType, int, int, int, CodeOffsets*, int, DebugInformationRecorder*, Dependencies*, CodeBuffer*, int, OopMapSet*, ExceptionHandlerTable*, ImplicitExceptionTable*, AbstractCompiler*, int)+0x364
V  [libjvm.so+0x12be420]  nmethod::new_nmethod(methodHandle const&, int, int, CodeOffsets*, int, DebugInformationRecorder*, Dependencies*, CodeBuffer*, int, OopMapSet*, ExceptionHandlerTable*, ImplicitExceptionTable*, AbstractCompiler*, int)+0x23c
V  [libjvm.so+0x81fedc]  ciEnv::register_method(ciMethod*, int, CodeOffsets*, int, CodeBuffer*, int, OopMapSet*, ExceptionHandlerTable*, ImplicitExceptionTable*, AbstractCompiler*, bool, bool, RTMState)+0x658
V  [libjvm.so+0x1369f1c]  PhaseOutput::install_code(ciMethod*, int, AbstractCompiler*, bool, bool, RTMState)+0x13c
V  [libjvm.so+0x957bf4]  Compile::Code_Gen()+0x404
V  [libjvm.so+0x960e2c]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x116c
V  [libjvm.so+0x797e5c]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x168
V  [libjvm.so+0x9715ec]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x90c
V  [libjvm.so+0x972124]  CompileBroker::compiler_thread_loop()+0x3e4
V  [libjvm.so+0x161c2d8]  JavaThread::thread_main_inner()+0x264
V  [libjvm.so+0x1622ec8]  Thread::call_run()+0xf8
V  [libjvm.so+0x1347dc0]  thread_native_entry(Thread*)+0x120
C  [libpthread.so.0+0x7d40]  start_thread+0xb4

Comments
Fix Request Should get backported for parity with 11.0.11-oracle. Doesn't apply cleanly. Review thread: http://mail.openjdk.java.net/pipermail/jdk-updates-dev/2021-January/004603.html
11-01-2021

Changeset: 695117f8 Author: Patric Hedlin <phedlin@openjdk.org> Date: 2020-11-24 18:56:58 +0000 URL: https://github.com/openjdk/jdk/commit/695117f8
24-11-2020

Reproducible on OL8.
10-11-2020

ILW = Assert in C2 during relocation, very intermittent on aarch64, no known workaround but disable compilation of affected method = HLM = P3
28-10-2020

Patric, could you please have a look?
28-10-2020