JDK-8268641 : [foreign] assert(allocates2(pc)) failed: not in CodeBuffer memory with ShenandoahGC
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,18
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-06-12
  • Updated: 2021-07-15
  • Resolved: 2021-06-17
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 JDK 18
17 b28Fixed 18Fixed
Related Reports
Relates :  
Description
The following tests failed with -XX:+UseShenandoahGC.
```
java/foreign/stackwalk/TestStackWalk.java
java/foreign/valist/VaListTest.java
java/foreign/TestUpcall.java
java/foreign/StdLibTest.java
```

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/jvm/jdk/src/hotspot/share/asm/codeBuffer.hpp:186), pid=61728, tid=61746
#  assert(allocates2(pc)) failed: not in CodeBuffer memory: 0x00007f7ff5696fa0 <= 0x00007f7ff56974a1 <= 0x00007f7ff56974a0
#
# JRE version: OpenJDK Runtime Environment (18.0) (fastdebug build 18-internal+0-adhoc.jvm.jdk)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 18-internal+0-adhoc.jvm.jdk, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, shenandoah gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x425f63]  CodeSection::set_end(unsigned char*)+0x53
#

Stack: [0x00007f7fecfe5000,0x00007f7fed0e6000],  sp=0x00007f7fed0e2918,  free space=1014k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x425f63]  CodeSection::set_end(unsigned char*)+0x53
V  [libjvm.so+0x5b974f]  Assembler::emit_operand_helper(int, int, int, Address::ScaleFactor, int, RelocationHolder const&, int)+0x41f
V  [libjvm.so+0x5ba4ee]  Assembler::emit_operand(RegisterImpl*, RegisterImpl*, RegisterImpl*, Address::ScaleFactor, int, RelocationHolder const&, int) [clone .constprop.101]+0x6e
V  [libjvm.so+0x60d2dd]  Assembler::movq(RegisterImpl*, Address)+0xed
V  [libjvm.so+0x1576a84]  ShenandoahBarrierSetAssembler::load_reference_barrier(MacroAssembler*, RegisterImpl*, Address, unsigned long) [clone .constprop.36]+0xe84
V  [libjvm.so+0x157bd33]  ShenandoahBarrierSetAssembler::load_at(MacroAssembler*, unsigned long, BasicType, RegisterImpl*, Address, RegisterImpl*, RegisterImpl*)+0x313
V  [libjvm.so+0x11f6a95]  MacroAssembler::resolve_jobject(RegisterImpl*, RegisterImpl*, RegisterImpl*)+0x375
V  [libjvm.so+0x182d95f]  ProgrammableUpcallHandler::generate_optimized_upcall_stub(_jobject*, Method*, _jobject*, _jobject*)+0x1c8f
V  [libjvm.so+0x1828acd]  PUH_AllocateOptimizedUpcallStub+0x75d
j  jdk.internal.foreign.abi.ProgrammableUpcallHandler.allocateOptimizedUpcallStub(Ljava/lang/invoke/MethodHandle;Ljdk/internal/foreign/abi/ABIDescriptor;Ljdk/internal/foreign/abi/ProgrammableUpcallHandler$CallRegs;)J+0 jdk.incubator.foreign@18-internal
j  jdk.internal.foreign.abi.ProgrammableUpcallHandler.make(Ljdk/internal/foreign/abi/ABIDescriptor;Ljava/lang/invoke/MethodHandle;Ljdk/internal/foreign/abi/CallingSequence;)Ljdk/internal/foreign/abi/UpcallHandler;+380 jdk.incubator.foreign@18-internal
j  jdk.internal.foreign.abi.x64.sysv.CallArranger.arrangeUpcall(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;Ljdk/incubator/foreign/FunctionDescriptor;)Ljdk/internal/foreign/abi/UpcallHandler;+28 jdk.incubator.foreign@18-internal
j  jdk.internal.foreign.abi.x64.sysv.SysVx64Linker.upcallStub(Ljava/lang/invoke/MethodHandle;Ljdk/incubator/foreign/FunctionDescriptor;Ljdk/incubator/foreign/ResourceScope;)Ljdk/incubator/foreign/MemoryAddress;+29 jdk.incubator.foreign@18-internal
j  TestStackWalk.main([Ljava/lang/String;)V+18
v  ~StubRoutines::call_stub
V  [libjvm.so+0xd8f0de]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x4de
V  [libjvm.so+0x14c50db]  invoke(InstanceKlass*, methodHandle const&, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, JavaThread*) [clone .constprop.488]+0xb4b
V  [libjvm.so+0x14c61dc]  Reflection::invoke_method(oop, Handle, objArrayHandle, JavaThread*)+0x1ac
V  [libjvm.so+0xf01273]  JVM_InvokeMethod+0x193
j  jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@18-internal
j  jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+133 java.base@18-internal
j  jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@18-internal
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@18-internal
j  com.sun.javatest.regtest.agent.MainWrapper$MainThread.run()V+172
j  java.lang.Thread.run()V+11 java.base@18-internal
v  ~StubRoutines::call_stub
V  [libjvm.so+0xd8f0de]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x4de
V  [libjvm.so+0xd8f7f8]  JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*)+0x338
V  [libjvm.so+0xd8f9ac]  JavaCalls::call_virtual(JavaValue*, Handle, Klass*, Symbol*, Symbol*, JavaThread*)+0x8c
V  [libjvm.so+0xef2b69]  thread_entry(JavaThread*, JavaThread*)+0x89
V  [libjvm.so+0x17e6c7a]  JavaThread::thread_main_inner()+0x2fa
V  [libjvm.so+0x17e6f1d]  JavaThread::run()+0x23d
V  [libjvm.so+0x17eba28]  Thread::call_run()+0xf8
V  [libjvm.so+0x13bea44]  thread_native_entry(Thread*)+0x104
Comments
Changeset: 112ddb76 Author: Jie Fu <jiefu@openjdk.org> Date: 2021-06-17 02:10:52 +0000 URL: https://git.openjdk.java.net/jdk17/commit/112ddb7633d8794d5c85e1b2cf0369ee2e0e349a
17-06-2021

ILW = Assertion failure in VM using Foreign Function and Memory API, with Shenandoah GC, use different GC = HLM = P3
14-06-2021