Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8200195

serviceability/jvmti/FieldAccessWatch/FieldAccessWatch.java crashes with "assert(thread->thread_state() == _thread_in_native) failed: coming from wrong thread state"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 11
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b10

      Description

      serviceability/jvmti/FieldAccessWatch/FieldAccessWatch.java crashes with assertion:

      # Internal Error (/home/katya/work/JavaSE/Hotspot/ws/jdk.hs/open/src/hotspot/share/runtime/interfaceSupport.inline.hpp:159), pid=21324, tid=21338
      # assert(thread->thread_state() == _thread_in_native) failed: coming from wrong thread state

      Current CompileTask:
      JVMCI: 1049 156 4 java.lang.String::hashCode (49 bytes)

      Stack: [0x00007fc7b632c000,0x00007fc7b642d000], sp=0x00007fc7b6428080, 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+0x180be52] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x162
      V [libjvm.so+0x180ccef] VMError::report_and_die(Thread*, char const*, int, char const*, char const*, __va_list_tag*)+0x2f
      V [libjvm.so+0xb1e66d] report_vm_error(char const*, int, char const*, char const*, ...)+0xdd
      V [libjvm.so+0x90387f] ThreadInVMfromNative::ThreadInVMfromNative(JavaThread*)+0x7f
      V [libjvm.so+0xfa5757] jni_GetFieldID+0xa7
      C [libFieldAccessWatch.so+0xbaf] handleNotification+0x20f
      V [libjvm.so+0x11665fa] JvmtiExport::post_field_access(JavaThread*, Method*, unsigned char*, Klass*, Handle, _jfieldID*)+0x1fa
      V [libjvm.so+0xe9a083] InterpreterRuntime::post_field_access(JavaThread*, oopDesc*, ConstantPoolCacheEntry*)+0x383
      j java.util.ArrayList$Itr.<init>(Ljava/util/ArrayList;)V+19 java.base@11-internal
      j java.util.ArrayList.iterator()Ljava/util/Iterator;+5 java.base@11-internal
      j java.lang.invoke.InvokerBytecodeGenerator.cpPatches([B)[Ljava/lang/Object;+14 java.base@11-internal
      j java.lang.invoke.InvokerBytecodeGenerator.loadMethod([B)Ljava/lang/invoke/MemberName;+3 java.base@11-internal
      j java.lang.invoke.InvokerBytecodeGenerator.generateCustomizedCode(Ljava/lang/invoke/LambdaForm;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MemberName;+29 java.base@11-internal
      j java.lang.invoke.LambdaForm.compileToBytecode()V+69 java.base@11-internal
      j java.lang.invoke.LambdaForm.prepare()V+21 java.base@11-internal
      j java.lang.invoke.MethodHandle.<init>(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;)V+33 java.base@11-internal
      j java.lang.invoke.BoundMethodHandle.<init>(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;)V+3 java.base@11-internal
      j java.lang.invoke.BoundMethodHandle$Species_LL.<init>(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;Ljava/lang/Object;Ljava/lang/Object;)V+3 java.base@11-internal
      j java.lang.invoke.BoundMethodHandle$Species_LL.make(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/invoke/BoundMethodHandle;+8 java.base@11-internal
      j java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+16 java.base@11-internal
      j java.lang.invoke.BoundMethodHandle$Species_L.copyWithExtendL(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;Ljava/lang/Object;)Ljava/lang/invoke/BoundMethodHandle;+19 java.base@11-internal
      j java.lang.invoke.LambdaFormEditor.bindArgumentL(Ljava/lang/invoke/BoundMethodHandle;ILjava/lang/Object;)Ljava/lang/invoke/BoundMethodHandle;+55 java.base@11-internal
      j java.lang.invoke.BoundMethodHandle.bindArgumentL(ILjava/lang/Object;)Ljava/lang/invoke/BoundMethodHandle;+7 java.base@11-internal
      j java.lang.invoke.MethodHandle.bindArgumentL(ILjava/lang/Object;)Ljava/lang/invoke/BoundMethodHandle;+6 java.base@11-internal
      j java.lang.invoke.MethodHandle.bindTo(Ljava/lang/Object;)Ljava/lang/invoke/MethodHandle;+15 java.base@11-internal
      j java.lang.invoke.MethodHandleImpl.makePairwiseConvertByEditor(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;ZZ)Ljava/lang/invoke/MethodHandle;+94 java.base@11-internal
      j java.lang.invoke.MethodHandleImpl.makePairwiseConvert(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;ZZ)Ljava/lang/invoke/MethodHandle;+18 java.base@11-internal
      j java.lang.invoke.MethodHandleImpl.makePairwiseConvert(Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;Z)Ljava/lang/invoke/MethodHandle;+4 java.base@11-internal
      j java.lang.invoke.MethodHandle.asTypeUncached(Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle;+51 java.base@11-internal
      j java.lang.invoke.MethodHandle.asType(Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/MethodHandle;+24 java.base@11-internal
      j java.lang.invoke.MethodHandleImpl$BindCaller.prepareForInvoker(Ljava/lang/invoke/MethodHandle;)Ljava/lang/invoke/MethodHandle;+20 java.base@11-internal
      j java.lang.invoke.MethodHandleImpl$BindCaller.bindCaller(Ljava/lang/invoke/MethodHandle;Ljava/lang/Class;)Ljava/lang/invoke/MethodHandle;+39 java.base@11-internal
      j java.lang.invoke.MethodHandleImpl.bindCaller(Ljava/lang/invoke/MethodHandle;Ljava/lang/Class;)Ljava/lang/invoke/MethodHandle;+2 java.base@11-internal
      j java.lang.invoke.MethodHandles$Lookup.maybeBindCaller(Ljava/lang/invoke/MemberName;Ljava/lang/invoke/MethodHandle;Ljava/lang/Class;)Ljava/lang/invoke/MethodHandle;+36 java.base@11-internal
      j java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(BLjava/lang/Class;Ljava/lang/invoke/MemberName;ZZLjava/lang/Class;)Ljava/lang/invoke/MethodHandle;+255 java.base@11-internal
      j java.lang.invoke.MethodHandles$Lookup.getDirectMethodNoSecurityManager(BLjava/lang/Class;Ljava/lang/invoke/MemberName;Ljava/lang/Class;)Ljava/lang/invoke/MethodHandle;+14 java.base@11-internal
      j java.lang.invoke.MethodHandles$Lookup.unreflect(Ljava/lang/reflect/Method;)Ljava/lang/invoke/MethodHandle;+114 java.base@11-internal
      j org.graalvm.compiler.serviceprovider.JDK9Method.lookupMethodHandle(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/invoke/MethodHandle;+9 jdk.internal.vm.compiler@11-internal
      j org.graalvm.compiler.serviceprovider.JDK9Method.<clinit>()V+116 jdk.internal.vm.compiler@11-internal
      v ~StubRoutines::call_stub
      V [libjvm.so+0xebded1] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x7e1
      V [libjvm.so+0xe73522] InstanceKlass::call_class_initializer(Thread*)+0x1c2
      V [libjvm.so+0xe73a37] InstanceKlass::initialize_impl(Thread*)+0x457
      V [libjvm.so+0xe73e3b] InstanceKlass::initialize(Thread*)+0x7b
      V [libjvm.so+0x11f2475] LinkResolver::resolve_field(fieldDescriptor&, LinkInfo const&, Bytecodes::Code, bool, Thread*)+0xc65
      V [libjvm.so+0x11f2b5a] LinkResolver::resolve_field_access(fieldDescriptor&, constantPoolHandle const&, int, methodHandle const&, Bytecodes::Code, Thread*)+0xca
      V [libjvm.so+0xe9ff56] InterpreterRuntime::resolve_get_put(JavaThread*, Bytecodes::Code)+0x206
      V [libjvm.so+0xea085b] InterpreterRuntime::resolve_from_cache(JavaThread*, Bytecodes::Code)+0xfb
      j org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.onSelection()V+66 jdk.internal.vm.compiler@11-internal
      j jdk.vm.ci.hotspot.HotSpotJVMCICompilerConfig.getCompilerFactory()Ljdk/vm/ci/runtime/JVMCICompilerFactory;+185 jdk.internal.vm.ci@11-internal
      j jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.<init>()V+230 jdk.internal.vm.ci@11-internal
      j jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.<init>(Ljdk/vm/ci/hotspot/HotSpotJVMCIRuntime$1;)V+1 jdk.internal.vm.ci@11-internal
      j jdk.vm.ci.hotspot.HotSpotJVMCIRuntime$DelayedInit.<clinit>()V+13 jdk.internal.vm.ci@11-internal
      v ~StubRoutines::call_stub
      V [libjvm.so+0xebded1] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x7e1
      V [libjvm.so+0xe73522] InstanceKlass::call_class_initializer(Thread*)+0x1c2
      V [libjvm.so+0xe73a37] InstanceKlass::initialize_impl(Thread*)+0x457
      V [libjvm.so+0xe73e3b] InstanceKlass::initialize(Thread*)+0x7b
      V [libjvm.so+0x11edd64] LinkResolver::resolve_static_call(CallInfo&, LinkInfo const&, bool, Thread*)+0xd4
      V [libjvm.so+0x11f5035] LinkResolver::resolve_invoke(CallInfo&, Handle, constantPoolHandle const&, int, Bytecodes::Code, Thread*)+0x135
      V [libjvm.so+0xe9dfe2] InterpreterRuntime::resolve_invoke(JavaThread*, Bytecodes::Code)+0x232
      V [libjvm.so+0xea084b] InterpreterRuntime::resolve_from_cache(JavaThread*, Bytecodes::Code)+0xeb
      j jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime()Ljdk/vm/ci/hotspot/HotSpotJVMCIRuntime;+3 jdk.internal.vm.ci@11-internal
      v ~StubRoutines::call_stub
      V [libjvm.so+0xebded1] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x7e1
      V [libjvm.so+0xe73522] InstanceKlass::call_class_initializer(Thread*)+0x1c2
      V [libjvm.so+0xe73a37] InstanceKlass::initialize_impl(Thread*)+0x457
      V [libjvm.so+0xe73e3b] InstanceKlass::initialize(Thread*)+0x7b
      V [libjvm.so+0x11edd64] LinkResolver::resolve_static_call(CallInfo&, LinkInfo const&, bool, Thread*)+0xd4
      V [libjvm.so+0x11f5035] LinkResolver::resolve_invoke(CallInfo&, Handle, constantPoolHandle const&, int, Bytecodes::Code, Thread*)+0x135
      V [libjvm.so+0xe9dfe2] InterpreterRuntime::resolve_invoke(JavaThread*, Bytecodes::Code)+0x232
      V [libjvm.so+0xea084b] InterpreterRuntime::resolve_from_cache(JavaThread*, Bytecodes::Code)+0xeb
      j jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime()Ljdk/vm/ci/hotspot/HotSpotJVMCIRuntime;+3 jdk.internal.vm.ci@11-internal
      v ~StubRoutines::call_stub
      V [libjvm.so+0xebded1] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x7e1
      V [libjvm.so+0xebc5a2] JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, Thread*)+0x212
      V [libjvm.so+0x10c1a76] JVMCIRuntime::callStatic(char const*, char const*, char const*, JavaCallArguments*, Thread*)+0x166
      V [libjvm.so+0x10c2260] JVMCIRuntime::initialize_HotSpotJVMCIRuntime(Thread*)+0xe0
      V [libjvm.so+0x10c33e3] JVM_GetJVMCIRuntime+0xe3
      j jdk.vm.ci.runtime.JVMCI.initializeRuntime()Ljdk/vm/ci/runtime/JVMCIRuntime;+0 jdk.internal.vm.ci@11-internal
      j jdk.vm.ci.runtime.JVMCI.<clinit>()V+2 jdk.internal.vm.ci@11-internal
      v ~StubRoutines::call_stub
      V [libjvm.so+0xebded1] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x7e1
      V [libjvm.so+0xe73522] InstanceKlass::call_class_initializer(Thread*)+0x1c2
      V [libjvm.so+0xe73a37] InstanceKlass::initialize_impl(Thread*)+0x457
      V [libjvm.so+0xe73e3b] InstanceKlass::initialize(Thread*)+0x7b
      V [libjvm.so+0x11edd64] LinkResolver::resolve_static_call(CallInfo&, LinkInfo const&, bool, Thread*)+0xd4
      V [libjvm.so+0xebc4ee] JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, Thread*)+0x15e
      V [libjvm.so+0x10c1a76] JVMCIRuntime::callStatic(char const*, char const*, char const*, JavaCallArguments*, Thread*)+0x166
      V [libjvm.so+0x10c32d7] JVMCIRuntime::initialize_JVMCI(Thread*)+0x147
      V [libjvm.so+0x10c3615] JVMCIRuntime::get_HotSpotJVMCIRuntime(Thread*)+0x15
      V [libjvm.so+0x105b76d] JVMCICompiler::compile_method(methodHandle const&, int, JVMCIEnv*)+0x18d
      V [libjvm.so+0xa90017] CompileBroker::invoke_compiler_on_method(CompileTask*)+0xca7
      V [libjvm.so+0xa90401] CompileBroker::compiler_thread_loop()+0x281
      V [libjvm.so+0x175f4ea] JavaThread::thread_main_inner()+0x21a
      V [libjvm.so+0x175f6f4] JavaThread::run()+0x144
      V [libjvm.so+0x148e69a] thread_native_entry(Thread*)+0xfa

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                amenkov Alex Menkov
                Reporter:
                epavlova Ekaterina Pavlova
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: