JDK-8292077 : G1 nmethod entry barriers don't keep oops alive
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 8,11,17,18,19,20
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-08-09
  • Updated: 2022-08-12
  • Resolved: 2022-08-11
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 20
20 masterFixed
Related Reports
Blocks :  
Description
The intention is that when G1 uses nmethod entry barriers, it keeps nmethod oops alive. It's easy enough to do it and makes the compiled code more robust. The current code fails to do that, even though it intended to. That should be fixed.
Comments
We got an assertion in our fastdebug nightly build after this change on Linux ppc64le . Might be related to the change. Command Line in the build where the assertion happens is : -Xms64M -Xmx1600M --add-exports=java.base/jdk.internal.module=ALL-UNNAMED build.tools.jigsaw.AddPackagesAttribute /nb/linuxppc64le/jdk-dev-build-fastdebug/jdk # To suppress the following error report, specify this argument # after -XX: or in .hotspotrc: SuppressErrorAt=/g1BarrierSet.inline.hpp:39 # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (/nb/linuxppc64le/jdk-dev/src/hotspot/share/gc/g1/g1BarrierSet.inline.hpp:39), pid=27195, tid=27200 # assert(oopDesc::is_oop(pre_val, true)) failed: Error # # JRE version: OpenJDK Runtime Environment (20.0) (fastdebug build 20-internal-adhoc.openjdk.jdk-dev) # Java VM: OpenJDK 64-Bit Server VM (fastdebug 20-internal-adhoc.openjdk.jdk-dev, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-ppc64le) # Problematic frame: # V [libjvm.so+0xc5532c] G1BarrierSet::enqueue_preloaded(oop)+0x28c
12-08-2022

backtrace and registers of the assertion are : Stack: [0x0000100002890000,0x0000100002a90000], sp=0x0000100002a8ca50, free space=2034k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0xc5532c] G1BarrierSet::enqueue_preloaded(oop)+0x28c V [libjvm.so+0xc4127c] G1CollectedHeap::keep_alive(oop)+0x4c V [libjvm.so+0x5266ac] BarrierSetNMethod::nmethod_entry_barrier(nmethod*)::OopKeepAliveClosure::do_oop(oop*)+0xac V [libjvm.so+0x1547b84] nmethod::oops_do(OopClosure*, bool)+0x84 V [libjvm.so+0x526d58] BarrierSetNMethod::nmethod_stub_entry_barrier(unsigned char**)+0xf8 v ~StubRoutines::nmethod_entry_barrier 0x000010000f4a6598 J 99 c1 java.lang.CharacterData.of(I)Ljava/lang/CharacterData; java.base (136 bytes) @ 0x000010000802ae34 [0x000010000802ae00+0x0000000000000034] j java.lang.Character.isJavaIdentifierPart(I)Z+1 java.base j jdk.internal.module.Checks.isJavaIdentifier(Ljava/lang/String;)Z+56 java.base j jdk.internal.module.Checks.requireTypeName(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+56 java.base j jdk.internal.module.Checks.requireQualifiedClassName(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;+2 java.base j jdk.internal.module.Checks.requireServiceTypeName(Ljava/lang/String;)Ljava/lang/String;+3 java.base j java.lang.module.ModuleDescriptor$Builder.uses(Ljava/lang/String;)Ljava/lang/module/ModuleDescriptor$Builder;+22 java.base j jdk.internal.module.ModuleInfo.readModuleAttribute(Ljava/io/DataInput;Ljdk/internal/module/ModuleInfo$ConstantPool;I)Ljava/lang/module/ModuleDescriptor$Builder;+1018 java.base j jdk.internal.module.ModuleInfo.doRead(Ljava/io/DataInput;)Ljdk/internal/module/ModuleInfo$Attributes;+542 java.base j jdk.internal.module.ModuleInfo.read(Ljava/io/InputStream;Ljava/util/function/Supplier;)Ljdk/internal/module/ModuleInfo$Attributes;+16 java.base j jdk.internal.module.ModulePath.readExplodedModule(Ljava/nio/file/Path;)Ljava/lang/module/ModuleReference;+35 java.base j jdk.internal.module.ModulePath.readModule(Ljava/nio/file/Path;Ljava/nio/file/attribute/BasicFileAttributes;)Ljava/lang/module/ModuleReference;+11 java.base j jdk.internal.module.ModulePath.scanDirectory(Ljava/nio/file/Path;)Ljava/util/Map;+69 java.base j jdk.internal.module.ModulePath.scan(Ljava/nio/file/Path;)Ljava/util/Map;+60 java.base j jdk.internal.module.ModulePath.scanNextEntry()V+23 java.base j jdk.internal.module.ModulePath.find(Ljava/lang/String;)Ljava/util/Optional;+36 java.base j jdk.internal.module.SystemModuleFinders$1.lambda$find$0(Ljava/lang/module/ModuleFinder;Ljava/lang/String;)Ljava/util/Optional;+2 java.base j jdk.internal.module.SystemModuleFinders$1$$Lambda$1+0x0000000100038f38.run()Ljava/lang/Object;+8 java.base j java.security.AccessController.executePrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/lang/Class;)Ljava/lang/Object;+29 java.base j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;)Ljava/lang/Object;+5 java.base j jdk.internal.module.SystemModuleFinders$1.find(Ljava/lang/String;)Ljava/util/Optional;+12 java.base j jdk.internal.module.ModuleBootstrap.boot2()Ljava/lang/ModuleLayer;+292 java.base j jdk.internal.module.ModuleBootstrap.boot()Ljava/lang/ModuleLayer;+64 java.base j java.lang.System.initPhase2(ZZ)I+0 java.base v ~StubRoutines::call_stub 0x000010000f41084c V [libjvm.so+0xf47654] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x694 V [libjvm.so+0x1606bbc] os::os_exception_wrapper(void (*)(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*), JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x3c V [libjvm.so+0xf48c04] JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, JavaThread*)+0x134 V [libjvm.so+0x1b03d80] Threads::create_vm(JavaVMInitArgs*, bool*)+0x730 V [libjvm.so+0x10f6e2c] JNI_CreateJavaVM+0xfc C [libjli.so+0x78a4] JavaMain+0xc4 C [libjli.so+0xcce8] ThreadJavaMain+0x18 C [libpthread.so.0+0x8a64] start_thread+0xf4 Registers: pc =0x0000100000f8532c lr =0x0000100000f850fc ctr=0x0000100000f71b60 r0 =0x0000100000f850fc r1 =0x0000100002a8ca50 r2 =0x00001000026c7b00 r3 =0x00001000020f9f28 r4 =0x0000000000000027 r5 =0x00001000020f9ef8 r6 =0x000010000211f918 r7 =0x0000000000000008 r8 =0x000010000276da40 r9 =0x0000100000070000 r10=0x0000000000000058 r11=0x0000100002a6ce20 r12=0x0000100000f71b60 r13=0x0000100002a968f0 r14=0x000010003414bbd1 r15=0x0000100002a8ce78 r16=0x00001000040279b0 r17=0x000000000000006e r18=0x0000100002a8cf10 r19=0x00001000342151d8 r20=0x0000000000000000 r21=0x0000100002a8ce10 r22=0x0000000000000025 r23=0x000000000000007c r24=0x000010000f433f38 r25=0x00001000027594a0 r26=0x0000100002a8cb28 r27=0x0000100002a8cb88 r28=0x0000100002a8cac8 r29=0x00001000027407d7 r30=0x0000000000000000 r31=0x0000100002a8ca50
12-08-2022

Changeset: 1c0f0f42 Author: Erik Ă–sterlund <eosterlund@openjdk.org> Date: 2022-08-11 11:45:11 +0000 URL: https://git.openjdk.org/jdk/commit/1c0f0f4211cf564c46753d2cb187c1ef485751cd
11-08-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/9817 Date: 2022-08-10 09:01:59 +0000
10-08-2022