JDK-8247251 : Assert '(_pcs_length == 0 || last_pc()->pc_offset() < pc_offset) failed: must specify a new, larger pc offset' failure
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 15,16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2020-06-09
  • Updated: 2020-11-11
  • Resolved: 2020-09-22
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.0.2Fixed 16 b17Fixed
Related Reports
Duplicate :  
Description
The following test failed in the JDK15 CI:

compiler/c2/Test6603011.java

Here's a snippet from the log file:

#section:main
----------messages:(5/355)----------
command: main -Xcomp -Xbatch -XX:-Inline compiler.c2.Test6603011
reason: User specified action: run main/othervm/timeout=480 -Xcomp -Xbatch -XX:-Inline compiler.c2.Test6603011 
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules java.base --add-exports java.base/jdk.internal.misc=ALL-UNNAMED
elapsed time (seconds): 98.675
----------configuration:(4/111)----------
Boot Layer
  add modules: java.base                   
  add exports: java.base/jdk.internal.misc ALL-UNNAMED

----------System.out:(19/1456)----------
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/debugInfoRec.cpp:176
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/scratch/mesos/slaves/63712a43-4eaa-429c-95b4-483ac8241123-S26/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/eee7edee-60d5-4d05-851f-d97cba876a0a/runs/680f5eeb-0057-4fb6-b5ab-e7487ac355b4/workspace/open/src/hotspot/share/code/debugInfoRec.cpp:176), pid=22500, tid=40707
#  assert(_pcs_length == 0 || last_pc()->pc_offset() < pc_offset) failed: must specify a new, larger pc offset
#
# JRE version: Java(TM) SE Runtime Environment (15.0+27) (fastdebug build 15-ea+27-1332)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 15-ea+27-1332, compiled mode, sharing, tiered, jvmci, jvmci compiler, compressed oops, g1 gc, bsd-amd64)
# Core dump will be written. Default location: core.22500
#
# An error report file with more information is saved as:
# /scratch/mesos/slaves/63712a43-4eaa-429c-95b4-483ac8241123-S981/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/ca000964-ef2e-4fab-91b2-c153692ffdf8/runs/d17f59f2-db76-4776-b334-75bf16184cd0/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_not_fast_compiler/scratch/1/hs_err_pid22500.log
[thread 33539 also had an error]
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#
----------System.err:(0/0)----------
----------rerun:(48/6249)*----------

Here's the crashing thread's stack:

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

Current thread (0x00007fc84280c820):  JavaThread "JVMCI CompilerThread0" daemon [_thread_in_vm, id=40707, stack(0x000070000d223000,0x000070000d323000)]


Current CompileTask:
JVMCI:  37880 1849       4       java.util.ArrayDeque::addLast (51 bytes)

Stack: [0x000070000d223000,0x000070000d323000],  sp=0x000070000d321020,  free space=1016k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0x109394d]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x6ed
V  [libjvm.dylib+0x1094081]  VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x41
V  [libjvm.dylib+0x5643c2]  report_vm_error(char const*, int, char const*, char const*, ...)+0x142
V  [libjvm.dylib+0x567a8f]  DebugInformationRecorder::add_new_pc_offset(int)+0x7f
V  [libjvm.dylib+0x567d22]  DebugInformationRecorder::add_non_safepoint(int)+0xb2
V  [libjvm.dylib+0x997712]  CodeInstaller::site_Infopoint(CodeBuffer&, int, JVMCIObject, JVMCIEnv*)+0x42
V  [libjvm.dylib+0x996465]  CodeInstaller::initialize_buffer(CodeBuffer&, bool, JVMCIEnv*)+0xf55
V  [libjvm.dylib+0x996b2f]  CodeInstaller::install(JVMCICompiler*, JVMCIObject, JVMCIObject, CodeBlob*&, JVMCIObject, FailedSpeculation**, char*, int, JVMCIEnv*)+0x3bf
V  [libjvm.dylib+0x9ad79f]  c2v_installCode(JNIEnv_*, _jobject*, _jobject*, _jobject*, _jobject*, long, _jbyteArray*)+0x6df
J 12503  jdk.vm.ci.hotspot.CompilerToVM.installCode(Ljdk/vm/ci/code/TargetDescription;Ljdk/vm/ci/hotspot/HotSpotCompiledCode;Ljdk/vm/ci/code/InstalledCode;J[B)I jdk.internal.vm.ci@15-ea (0 bytes) @ 0x000000012150ad9d [0x000000012150ac60+0x000000000000013d]
J 12499 c1 jdk.vm.ci.hotspot.HotSpotCodeCacheProvider.installCode(Ljdk/vm/ci/meta/ResolvedJavaMethod;Ljdk/vm/ci/code/CompiledCode;Ljdk/vm/ci/code/InstalledCode;Ljdk/vm/ci/meta/SpeculationLog;Z)Ljdk/vm/ci/code/InstalledCode; jdk.internal.vm.ci@15-ea (312 bytes) @ 0x0000000121516d34 [0x0000000121516800+0x0000000000000534]
J 12900 c1 org.graalvm.compiler.core.target.Backend.createInstalledCode(Lorg/graalvm/compiler/debug/DebugContext;Ljdk/vm/ci/meta/ResolvedJavaMethod;Ljdk/vm/ci/code/CompilationRequest;Lorg/graalvm/compiler/code/CompilationResult;Ljdk/vm/ci/code/InstalledCode;Z[Ljava/lang/Object;)Ljdk/vm/ci/code/InstalledCode; jdk.internal.vm.compiler@15-ea (316 bytes) @ 0x000000012157fb5c [0x000000012157f300+0x000000000000085c]
J 12899 c1 org.graalvm.compiler.hotspot.CompilationTask.installMethod(Lorg/graalvm/compiler/debug/DebugContext;Lorg/graalvm/compiler/code/CompilationResult;)V jdk.internal.vm.compiler@15-ea (168 bytes) @ 0x0000000121578efc [0x00000001215788c0+0x000000000000063c]
J 12634 c1 org.graalvm.compiler.hotspot.CompilationTask$HotSpotCompilationWrapper.performCompilation(Lorg/graalvm/compiler/debug/DebugContext;)Ljdk/vm/ci/hotspot/HotSpotCompilationRequestResult; jdk.internal.vm.compiler@15-ea (358 bytes) @ 0x000000012153d7ac [0x000000012153d340+0x000000000000046c]
J 12633 c1 org.graalvm.compiler.hotspot.CompilationTask$HotSpotCompilationWrapper.performCompilation(Lorg/graalvm/compiler/debug/DebugContext;)Ljava/lang/Object; jdk.internal.vm.compiler@15-ea (6 bytes) @ 0x00000001215344f4 [0x00000001215344c0+0x0000000000000034]
J 12632 c1 org.graalvm.compiler.core.CompilationWrapper.run(Lorg/graalvm/compiler/debug/DebugContext;)Ljava/lang/Object; jdk.internal.vm.compiler@15-ea (1186 bytes) @ 0x000000012154abf4 [0x000000012154aba0+0x0000000000000054]
J 12623 c1 org.graalvm.compiler.hotspot.CompilationTask.runCompilation(Lorg/graalvm/compiler/debug/DebugContext;)Ljdk/vm/ci/hotspot/HotSpotCompilationRequestResult; jdk.internal.vm.compiler@15-ea (349 bytes) @ 0x0000000121534cf4 [0x0000000121534ac0+0x0000000000000234]
J 12599 c1 org.graalvm.compiler.hotspot.HotSpotGraalCompiler.compileMethod(Ljdk/vm/ci/code/CompilationRequest;ZLorg/graalvm/compiler/options/OptionValues;)Ljdk/vm/ci/code/CompilationRequestResult; jdk.internal.vm.compiler@15-ea (554 bytes) @ 0x0000000121537a24 [0x0000000121537180+0x00000000000008a4]
J 12598 c1 org.graalvm.compiler.hotspot.HotSpotGraalCompiler.compileMethod(Ljdk/vm/ci/code/CompilationRequest;)Ljdk/vm/ci/code/CompilationRequestResult; jdk.internal.vm.compiler@15-ea (16 bytes) @ 0x0000000121526bc4 [0x0000000121526b00+0x00000000000000c4]
J 12595 c1 jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.compileMethod(Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethod;IJI)Ljdk/vm/ci/hotspot/HotSpotCompilationRequestResult; jdk.internal.vm.ci@15-ea (112 bytes) @ 0x0000000121525804 [0x0000000121525700+0x0000000000000104]
v  ~StubRoutines::call_stub
V  [libjvm.dylib+0x815d89]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x5a9
V  [libjvm.dylib+0x814867]  JavaCalls::call_special(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x187
V  [libjvm.dylib+0xa1561b]  JVMCIEnv::call_HotSpotJVMCIRuntime_compileMethod(JVMCIObject, JVMCIObject, int, long, int)+0x4db
V  [libjvm.dylib+0xa8fa7c]  JVMCIRuntime::compile_method(JVMCIEnv*, JVMCICompiler*, methodHandle const&, int)+0x28c
V  [libjvm.dylib+0x5267fc]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x4bc
V  [libjvm.dylib+0x52604c]  CompileBroker::compiler_thread_loop()+0x34c
V  [libjvm.dylib+0xfed6d3]  JavaThread::thread_main_inner()+0x2a3
V  [libjvm.dylib+0xfe8977]  Thread::call_run()+0x1b7
V  [libjvm.dylib+0xdb179f]  thread_native_entry(Thread*)+0x15f
C  [libsystem_pthread.dylib+0x3661]  _pthread_body+0x154
C  [libsystem_pthread.dylib+0x350d]  _pthread_body+0x0
C  [libsystem_pthread.dylib+0x2bf9]  thread_start+0xd

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 12503  jdk.vm.ci.hotspot.CompilerToVM.installCode(Ljdk/vm/ci/code/TargetDescription;Ljdk/vm/ci/hotspot/HotSpotCompiledCode;Ljdk/vm/ci/code/InstalledCode;J[B)I jdk.internal.vm.ci@15-ea (0 bytes) @ 0x000000012150ad23 [0x000000012150ac60+0x00000000000000c3]
J 12499 c1 jdk.vm.ci.hotspot.HotSpotCodeCacheProvider.installCode(Ljdk/vm/ci/meta/ResolvedJavaMethod;Ljdk/vm/ci/code/CompiledCode;Ljdk/vm/ci/code/InstalledCode;Ljdk/vm/ci/meta/SpeculationLog;Z)Ljdk/vm/ci/code/InstalledCode; jdk.internal.vm.ci@15-ea (312 bytes) @ 0x0000000121516d34 [0x0000000121516800+0x0000000000000534]
J 12900 c1 org.graalvm.compiler.core.target.Backend.createInstalledCode(Lorg/graalvm/compiler/debug/DebugContext;Ljdk/vm/ci/meta/ResolvedJavaMethod;Ljdk/vm/ci/code/CompilationRequest;Lorg/graalvm/compiler/code/CompilationResult;Ljdk/vm/ci/code/InstalledCode;Z[Ljava/lang/Object;)Ljdk/vm/ci/code/InstalledCode; jdk.internal.vm.compiler@15-ea (316 bytes) @ 0x000000012157fb5c [0x000000012157f300+0x000000000000085c]
J 12899 c1 org.graalvm.compiler.hotspot.CompilationTask.installMethod(Lorg/graalvm/compiler/debug/DebugContext;Lorg/graalvm/compiler/code/CompilationResult;)V jdk.internal.vm.compiler@15-ea (168 bytes) @ 0x0000000121578efc [0x00000001215788c0+0x000000000000063c]
J 12634 c1 org.graalvm.compiler.hotspot.CompilationTask$HotSpotCompilationWrapper.performCompilation(Lorg/graalvm/compiler/debug/DebugContext;)Ljdk/vm/ci/hotspot/HotSpotCompilationRequestResult; jdk.internal.vm.compiler@15-ea (358 bytes) @ 0x000000012153d7ac [0x000000012153d340+0x000000000000046c]
J 12633 c1 org.graalvm.compiler.hotspot.CompilationTask$HotSpotCompilationWrapper.performCompilation(Lorg/graalvm/compiler/debug/DebugContext;)Ljava/lang/Object; jdk.internal.vm.compiler@15-ea (6 bytes) @ 0x00000001215344f4 [0x00000001215344c0+0x0000000000000034]
J 12632 c1 org.graalvm.compiler.core.CompilationWrapper.run(Lorg/graalvm/compiler/debug/DebugContext;)Ljava/lang/Object; jdk.internal.vm.compiler@15-ea (1186 bytes) @ 0x000000012154abf4 [0x000000012154aba0+0x0000000000000054]
J 12623 c1 org.graalvm.compiler.hotspot.CompilationTask.runCompilation(Lorg/graalvm/compiler/debug/DebugContext;)Ljdk/vm/ci/hotspot/HotSpotCompilationRequestResult; jdk.internal.vm.compiler@15-ea (349 bytes) @ 0x0000000121534cf4 [0x0000000121534ac0+0x0000000000000234]
J 12599 c1 org.graalvm.compiler.hotspot.HotSpotGraalCompiler.compileMethod(Ljdk/vm/ci/code/CompilationRequest;ZLorg/graalvm/compiler/options/OptionValues;)Ljdk/vm/ci/code/CompilationRequestResult; jdk.internal.vm.compiler@15-ea (554 bytes) @ 0x0000000121537a24 [0x0000000121537180+0x00000000000008a4]
J 12598 c1 org.graalvm.compiler.hotspot.HotSpotGraalCompiler.compileMethod(Ljdk/vm/ci/code/CompilationRequest;)Ljdk/vm/ci/code/CompilationRequestResult; jdk.internal.vm.compiler@15-ea (16 bytes) @ 0x0000000121526bc4 [0x0000000121526b00+0x00000000000000c4]
J 12595 c1 jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.compileMethod(Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethod;IJI)Ljdk/vm/ci/hotspot/HotSpotCompilationRequestResult; jdk.internal.vm.ci@15-ea (112 bytes) @ 0x0000000121525804 [0x0000000121525700+0x0000000000000104]
v  ~StubRoutines::call_stub
Comments
Fix Request for JDK 15 update. It fixed regression bug in Graal. Patch from JDK 16 applied cleanly. https://github.com/openjdk/jdk/pull/272
13-10-2020

Changeset: 24e12b38 Author: Vladimir Kozlov <kvn@openjdk.org> Date: 2020-09-22 15:41:12 +0000 URL: https://git.openjdk.java.net/jdk/commit/24e12b38
22-09-2020

This should be fixed by https://github.com/oracle/graal/commit/438a7cb0257 which should be in the next Graal update.
08-09-2020

I believe I've narrow this down to a particular Graal changeset https://github.com/oracle/graal/commit/ba46378680dd177214b9446b82e085d707e942c3 and I'm inspecting it now for any visible issues. This supports the idea that the deopt state is the source of the problem.
14-08-2020

It reproduces about 1 in 200-300 times for me. I didn't show up with JDK15+30 and there was a single Graal fix there so I backported that into 15+27 and it still happens. I also anti-delta'd an arraycopy change but that wasn't it either. I'm trying to latest jdk16 which includes another Graal update in hopes that it's something we've already fixed.
07-07-2020

I have been able to reproduce it but most additions of debug logic and extra flags cause it to disappear. I'm going to try bisecting it.
03-07-2020

I notice just before the crash a deopt in TimSort.mergeLo. Event: 37.879 Thread 0x00007fc84280c820 Uncommon trap: trap_request=0xffffffed fr.pc=0x00000001215bcef1 relative=0x0000000000001931 Event: 37.879 Thread 0x00007fc84280c820 Uncommon trap: reason=null_assert_or_unreached0 action=reinterpret pc=0x00000001215bcef1 method=java.util.TimSort.mergeLo(IIII)V @ 404 jvmci Event: 37.879 Thread 0x00007fc84280c820 DEOPT PACKING pc=0x00000001215bcef1 sp=0x000070000d321700 Event: 37.879 Thread 0x00007fc84280c820 DEOPT UNPACKING pc=0x00000001164be721 sp=0x000070000d320bb0 mode 3 The windows crash has the exact same output just before the crash. I'm guessing that we deopt in the gallop logic and somehow restart the gallop, making 2 copies of the same run.
25-06-2020

I can't seem to reproduce it so I've been looking at the core file. There seems to be a duplicated set of BYTECODE_POSITIONs in the middle of the sites list so that's why we fail the assert. I don't have an explanation for the extra positions. They are literally the same object so I think it means something went wrong with the merging of the sites since these objects should all be unique.
24-06-2020

[~dnsimon] It looks like cause by last Graal Update. Please assign it.
22-06-2020