JDK-8203031 : segfaults from jvmti_AddToBootstrapClassLoaderSearch
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2018-05-13
  • Updated: 2018-06-11
  • Resolved: 2018-05-31
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
11 b17Fixed
Related Reports
Relates :  
Description
java/lang/instrument/executableJAR/ExecJarWithAgent.java fails with a
segfault on multiple platforms.

Seeing similar failures in other tests, with
jvmti_AddToBootstrapClassLoaderSearch in the stack trace.

stack trace from an hs_err file:
Stack: [0x00007f5ac4011000,0x00007f5ac4112000],  sp=0x00007f5ac410dbd0,  free space=1010k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x959b97]  ClassLoaderExt::append_boot_classpath(ClassPathEntry*)+0x27
V  [libjvm.so+0x1146c54]  JvmtiEnv::AddToBootstrapClassLoaderSearch(char const*)+0x154
V  [libjvm.so+0x10cbfe7]  jvmti_AddToBootstrapClassLoaderSearch+0x157
C  [libinstrument.so+0x24d1]  appendBootClassPath.isra.2+0x5a1
C  [libinstrument.so+0x2e35]  loadAgent+0x105
C  [libinstrument.so+0x1d64]  Java_sun_instrument_InstrumentationImpl_loadAgent0+0x14
j  sun.instrument.InstrumentationImpl.loadAgent0(Ljava/lang/String;)V+0 java.instrument@11-internal
j  sun.instrument.InstrumentationImpl.loadAgent(Ljava/lang/String;)V+1 java.instrument@11-internal
v  ~StubRoutines::call_stub
V  [libjvm.so+0xe952da]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x85a
V  [libjvm.so+0x15d05fc]  invoke(InstanceKlass*, methodHandle const&, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, Thread*) [clone .constprop.98]+0xbcc
V  [libjvm.so+0x15d50e6]  Reflection::invoke_method(oop, Handle, objArrayHandle, Thread*)+0x196
V  [libjvm.so+0x100d4f6]  JVM_InvokeMethod+0x1d6
j  jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@11-internal
j  jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100 java.base@11-internal
j  jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@11-internal
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@11-internal
j  sun.launcher.LauncherHelper.lambda$getMainClassFromJar$0(Ljava/lang/String;Ljava/lang/Module;)V+40 java.base@11-internal
j  sun.launcher.LauncherHelper$$Lambda$1.accept(Ljava/lang/Object;)V+8 java.base@11-internal
j  java.util.Optional.ifPresent(Ljava/util/function/Consumer;)V+12 java.base@11-internal
j  sun.launcher.LauncherHelper.getMainClassFromJar(Ljava/lang/String;)Ljava/lang/String;+111 java.base@11-internal
j  sun.launcher.LauncherHelper.loadMainClass(ILjava/lang/String;)Ljava/lang/Class;+34 java.base@11-internal
j  sun.launcher.LauncherHelper.checkAndLoadMain(ZILjava/lang/String;)Ljava/lang/Class;+18 java.base@11-internal
v  ~StubRoutines::call_stub
V  [libjvm.so+0xe952da]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x85a
V  [libjvm.so+0xf79156]  jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) [clone .isra.99] [clone .constprop.215]+0x236
V  [libjvm.so+0xfa55a2]  jni_CallStaticObjectMethod+0x222
C  [libjli.so+0x433f]  JavaMain+0x52f

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  sun.instrument.InstrumentationImpl.loadAgent0(Ljava/lang/String;)V+0 java.instrument@11-internal
j  sun.instrument.InstrumentationImpl.loadAgent(Ljava/lang/String;)V+1 java.instrument@11-internal
v  ~StubRoutines::call_stub
j  jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 java.base@11-internal
j  jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+100 java.base@11-internal
j  jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+6 java.base@11-internal
j  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+59 java.base@11-internal
j  sun.launcher.LauncherHelper.lambda$getMainClassFromJar$0(Ljava/lang/String;Ljava/lang/Module;)V+40 java.base@11-internal
j  sun.launcher.LauncherHelper$$Lambda$1.accept(Ljava/lang/Object;)V+8 java.base@11-internal
j  java.util.Optional.ifPresent(Ljava/util/function/Consumer;)V+12 java.base@11-internal
j  sun.launcher.LauncherHelper.getMainClassFromJar(Ljava/lang/String;)Ljava/lang/String;+111 java.base@11-internal
j  sun.launcher.LauncherHelper.loadMainClass(ILjava/lang/String;)Ljava/lang/Class;+34 java.base@11-internal
j  sun.launcher.LauncherHelper.checkAndLoadMain(ZILjava/lang/String;)Ljava/lang/Class;+18 java.base@11-internal
v  ~StubRoutines::call_stub

Comments
Regression caused by JDK-8193213 FileMapInfo::current_info() is NULL when CDS is turned off, this causes crash at ClassLoaderExt::append_boot_classpath
29-05-2018

Increased priority as AddToBootstrapClassLoaderSearch doesn't work at all (causes crash)
29-05-2018

to reproduce locally: make run-test TEST=closed/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch007 TEST_VM_OPTS="-XX:-UseCompressedOops"
24-05-2018

reproduced the issue with mach5 and with local build Only debug build fail Reproducible with VM option "-XX:-UseCompressedOops"
24-05-2018