JDK-8245128 : Kitchensink fails with: assert(destination == (address)-1 || destination == entry) failed: b) MT-unsafe modification of inline cache
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-05-15
  • Updated: 2020-07-24
  • Resolved: 2020-06-25
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 15 JDK 16
15 b30Fixed 16Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
The Kitchensink test with the Instrumentation module enabled can fail with the following assert:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/opt/mach5/mesos/work_dir/slaves/805146e6-8fdb-4552-bf9e-385b73cf7129-S464/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8c50b523-8fc9-40b9-bc94-d41e927e6257/runs/069ea4d4-9be3-4bae-973a-2cc8c31bbd5f/workspace/open/src/hotspot/share/code/compiledIC.cpp:759), pid=536, tid=641
#  assert(destination == (address)-1 || destination == entry) failed: b) MT-unsafe modification of inline cache
#
# JRE version: Java(TM) SE Runtime Environment (15.0) (fastdebug build 15-internal+0-2020-05-15-1050254.serguei.spitsyn.jdk15.2)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 15-internal+0-2020-05-15-1050254.serguei.spitsyn.jdk15.2, compiled mode, sharing, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x91c50d]  CompiledDirectStaticCall::verify_mt_safe(methodHandle const&, unsigned char*, NativeMovConstReg*, NativeJump*)+0x7d
#
# Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /opt/mach5/mesos/work_dir/slaves/805146e6-8fdb-4552-bf9e-385b73cf7129-S441/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/33a95af5-b9bc-422f-bd5b-2f52ab8b1bbf/runs/8167fb74-7800-4550-b93e-2224fc2f5711/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_kitchensink_Kitchensink_java/scratch/0/core.536)
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

---------------  S U M M A R Y ------------

Command Line: -Xbootclasspath/a:/opt/mach5/mesos/work_dir/slaves/805146e6-8fdb-4552-bf9e-385b73cf7129-S441/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/33a95af5-b9bc-422f-bd5b-2f52ab8b1bbf/runs/8167fb74-7800-4550-b93e-2224fc2f5711/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_kitchensink_Kitchensink_java/scratch/0/wb.jar -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:MaxRAMPercentage=6 -Xlog:class+redefine*=info -Xcomp -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -XX:-TieredCompilation -XX:+CreateCoredumpOnCrash -XX:MaxRAMPercentage=50 -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+CrashOnOutOfMemoryError -Djava.net.preferIPv6Addresses=false -XX:+DisplayVMOutputToStderr -Xlog:gc*,gc+heap=debug:gc.log:uptime,timemillis,level,tags -XX:+DisableExplicitGC -XX:+StartAttachListener --illegal-access=deny --add-modules=jdk.incubator.foreign --add-exports=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-exports=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-exports=java.xml/com.sun.org.apache.xerces.internal.parsers=ALL-UNNAMED --add-exports=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED -Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/805146e6-8fdb-4552-bf9e-385b73cf7129-S441/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/33a95af5-b9bc-422f-bd5b-2f52ab8b1bbf/runs/8167fb74-7800-4550-b93e-2224fc2f5711/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_kitchensink_Kitchensink_java/scratch/0/java.io.tmpdir -Duser.home=/opt/mach5/mesos/work_dir/slaves/805146e6-8fdb-4552-bf9e-385b73cf7129-S441/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/33a95af5-b9bc-422f-bd5b-2f52ab8b1bbf/runs/8167fb74-7800-4550-b93e-2224fc2f5711/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_kitchensink_Kitchensink_java/scratch/0/user.home -agentpath:/opt/mach5/mesos/work_dir/jib-master/install/2020-05-15-1050254.serguei.spitsyn.jdk15.2/linux-x64-debug.test/hotspot/jtreg/native/libJvmtiStressModule.so -Xverify:all -javaagent:redefineagent.jar -XX:NativeMemoryTracking=detail -Djdk.test.lib.random.seed=5726200994590302437 applications.kitchensink.process.stress.Main /opt/mach5/mesos/work_dir/slaves/805146e6-8fdb-4552-bf9e-385b73cf7129-S441/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/33a95af5-b9bc-422f-bd5b-2f52ab8b1bbf/runs/8167fb74-7800-4550-b93e-2224fc2f5711/testoutput/test-support/jtreg_closed_test_hotspot_jtreg_applications_kitchensink_Kitchensink_java/scratch/0/kitchensink.final.properties

Host: ol7-build-test-228575, Intel(R) Xeon(R) Platinum 8167M CPU @ 2.00GHz, 8 cores, 58G, Oracle Linux Server release 7.8
Time: Fri May 15 11:46:16 2020 UTC elapsed time: 1373.264443 seconds (0d 0h 22m 53s)

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

Current thread (0x00007f220461c000):  JavaThread "JniStressModule" [_thread_in_vm, id=641, stack(0x00007f21a2266000,0x00007f21a2367000)]

Stack: [0x00007f21a2266000,0x00007f21a2367000],  sp=0x00007f21a2362140,  free space=1008k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x91c50d]  CompiledDirectStaticCall::verify_mt_safe(methodHandle const&, unsigned char*, NativeMovConstReg*, NativeJump*)+0x7d
V  [libjvm.so+0x91e646]  CompiledDirectStaticCall::set_to_interpreted(methodHandle const&, unsigned char*)+0x66
V  [libjvm.so+0x91b8ce]  CompiledStaticCall::set(StaticCallInfo const&)+0xfe
V  [libjvm.so+0x150ea1f]  SharedRuntime::resolve_sub_helper_internal(methodHandle, frame const&, CompiledMethod*, bool, bool, Handle, CallInfo&, Bytecodes::Code, Thread*)+0x63f
V  [libjvm.so+0x151aa08]  SharedRuntime::resolve_sub_helper(JavaThread*, bool, bool, Thread*)+0x3f8
V  [libjvm.so+0x151adf9]  SharedRuntime::resolve_helper(JavaThread*, bool, bool, Thread*)+0xa9
V  [libjvm.so+0x151b0a1]  SharedRuntime::resolve_static_call_C(JavaThread*)+0x131
v  ~RuntimeStub::resolve_static_call
J 69672 c2 java.lang.Class.getMethodsRecursive(Ljava/lang/String;[Ljava/lang/Class;Z)Ljava/lang/PublicMethods$MethodList; java.base@15-internal (99 bytes) @ 0x00007f21f951e5b4 [0x00007f21f951e540+0x0000000000000074]
j  java.lang.Class.getMethod0(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;+14 java.base@15-internal
j  java.lang.Class.getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;+26 java.base@15-internal
j  applications.kitchensink.process.stress.modules.JniStressModule.runOneIteration()V+637
j  applications.kitchensink.process.stress.modules.JniStressModule.execute()V+20
j  applications.kitchensink.process.stress.modules.StressModule.run()V+109
v  ~StubRoutines::call_stub
V  [libjvm.so+0xce2cbc]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x6ac
V  [libjvm.so+0xce33fb]  JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x4db
V  [libjvm.so+0xce38ae]  JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, Thread*)+0xbe
V  [libjvm.so+0xe5d64e]  thread_entry(JavaThread*, Thread*)+0x12e
V  [libjvm.so+0x16a7ac6]  JavaThread::thread_main_inner()+0x226
V  [libjvm.so+0x16ad960]  Thread::call_run()+0x100
V  [libjvm.so+0x13b2396]  thread_native_entry(Thread*)+0x116

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
v  ~RuntimeStub::resolve_static_call
J 69672 c2 java.lang.Class.getMethodsRecursive(Ljava/lang/String;[Ljava/lang/Class;Z)Ljava/lang/PublicMethods$MethodList; java.base@15-internal (99 bytes) @ 0x00007f21f951e5b4 [0x00007f21f951e540+0x0000000000000074]
j  java.lang.Class.getMethod0(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;+14 java.base@15-internal
j  java.lang.Class.getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;+26 java.base@15-internal
j  applications.kitchensink.process.stress.modules.JniStressModule.runOneIteration()V+637
j  applications.kitchensink.process.stress.modules.JniStressModule.execute()V+20
j  applications.kitchensink.process.stress.modules.StressModule.run()V+109
v  ~StubRoutines::call_stub
Register to memory mapping:

RAX=0x00007f220b8a3000 points into unknown readable memory: 58 00 00 00 00 00 00 00
RBX=0x00007f21f951e8b9 is at entry_point+889 in (nmethod*)0x00007f21f951e310
RCX=0x00007f220a6e6018: <offset 0x00000000018da018> in /opt/mach5/mesos/work_dir/jib-master/install/2020-05-15-1050254.serguei.spitsyn.jdk15.2/linux-x64-debug.jdk/jdk-15/fastdebug/lib/server/libjvm.so at 0x00007f2208e0c000
RDX=0x00007f220a6e6048: <offset 0x00000000018da048> in /opt/mach5/mesos/work_dir/jib-master/install/2020-05-15-1050254.serguei.spitsyn.jdk15.2/linux-x64-debug.jdk/jdk-15/fastdebug/lib/server/libjvm.so at 0x00007f2208e0c000
RSP=0x00007f21a2362140 is pointing into the stack for thread: 0x00007f220461c000
RBP=0x00007f21a2362160 is pointing into the stack for thread: 0x00007f220461c000
RSI=0x00000000000002f7 is an unknown value
RDI=0x00007f220a6e5138: <offset 0x00000000018d9138> in /opt/mach5/mesos/work_dir/jib-master/install/2020-05-15-1050254.serguei.spitsyn.jdk15.2/linux-x64-debug.jdk/jdk-15/fastdebug/lib/server/libjvm.so at 0x00007f2208e0c000
R8 =0x00007f21f951e8b9 is at entry_point+889 in (nmethod*)0x00007f21f951e310
R9 =0x0000000000000001 is an unknown value
R10=0x00007f21f951e4fe is at entry_point+-66 in (nmethod*)0x00007f21f951e310
R11=0x0000000000000202 is an unknown value
R12=0x00007f21a2362210 is pointing into the stack for thread: 0x00007f220461c000
R13=0x00007f21f93ea3d3 is at code_begin+243 in an AdapterHandler
Adapter for signature: 0x00007f21f93ea3d3 is at code_begin+243 in 
[CodeBlob (0x00007f21f93ea210)]
Framesize: 0
BufferBlob (0x00007f21f93ea210) used for I2C/C2I adapters
R14={method} {0x000000080011beb0} 'filter' '([Ljava/lang/reflect/Method;Ljava/lang/String;[Ljava/lang/Class;Z)Ljava/lang/PublicMethods$MethodList;' in 'java/lang/PublicMethods$MethodList'
R15=0x00007f21f951e8b9 is at entry_point+889 in (nmethod*)0x00007f21f951e310

This problem is intermittent. It is normally reproduced once in 20-40 Kitchensink runs.
The Kitchensink Instrumentation module needs to be enabled.
Also, the options to use are:
  -Xlog:class+redefine*=trace -Xcomp -ea -esa -XX:CompileThreshold=100 -XX:+UnlockExperimentalVMOptions -XX:-TieredCompilation -XX:+CreateCoredumpOnCrash 
Comments
Changeset: 601e566b Author: Christian Hagedorn <chagedorn@openjdk.org> Date: 2020-06-25 11:43:20 +0000 URL: https://git.openjdk.java.net/mobile/commit/601e566b
02-07-2020

URL: https://hg.openjdk.java.net/jdk/jdk15/rev/19c29c71bf2a User: chagedorn Date: 2020-06-25 10:58:25 +0000
25-06-2020

The patch to enable Instrumentation module: diff --git a/closed/test/hotspot/jtreg/applications/kitchensink/kitchensink.properties b/closed/test/hotspot/jtreg/applications/kitchensink/kitchensink.properties --- a/closed/test/hotspot/jtreg/applications/kitchensink/kitchensink.properties +++ b/closed/test/hotspot/jtreg/applications/kitchensink/kitchensink.properties @@ -14,7 +14,7 @@ #user.dir modules.additional= -modules.enable=Allocator,Exception,Jcmd,Jfr,Jni,Jstat,Jvmti,Inflater,LockDeflation,MBean,MemAccess,Monitor,NMT,Perfmon,Reference,SpecJbb2005,SpecJvm2008Batch,ThreadDumper,${modules.additional} +modules.enable=Allocator,Exception,Jcmd,Jfr,Jni,Jstat,Jvmti,Inflater,Instrumentation,LockDeflation,MBean,MemAccess,Monitor,NMT,Perfmon,Reference,SpecJbb2005,SpecJvm2008Batch,ThreadDumper,${modules.additional} test.duration=30m result.analyzer.definition.files=kitchensink.stress.def,kitchensink.perf.def
19-05-2020