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

[Nestmates] VM Compiler thread needs to load nest-host class!

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: hotspot
    • Labels:

      Description

      There may be times (e.g. using -Xcomp) when the compiler thread is the first to try and load a nest-host class as a side-effect of the access control check. If it does then we hit an assertion failure:

      # assert(__the_thread__->can_call_java()) failed: can not load classes with compiler thread: class=NoCallerMissingHost, classloader=jdk/internal/loader/ClassLoaders$AppClassLoader

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

      Current thread (0x00007fcd845a5000): JavaThread "C1 CompilerThread10" daemon [_thread_in_vm, id=6461, stack(0x00007fccc0190000,0x00007fccc0291000)]

      Current CompileTask:
      C1: 14200 2626 b 3 TestNestmateMembership$CallerMissingHost::invokeTarget (4 bytes)

      Stack: [0x00007fccc0190000,0x00007fccc0291000], sp=0x00007fccc028df60, free space=1015k
      Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x17792a2] 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+0x177a06f] VMError::report_and_die(Thread*, char const*, int, char const*, char const*, __va_list_tag*)+0x2f
      V [libjvm.so+0xb1250d] report_vm_error(char const*, int, char const*, char const*, ...)+0xdd
      V [libjvm.so+0x168f14e] SystemDictionary::resolve_instance_class_or_null(Symbol*, Handle, Handle, Thread*)+0x67e
      V [libjvm.so+0x168fd44] SystemDictionary::resolve_or_null(Symbol*, Handle, Handle, Thread*)+0x44
      V [libjvm.so+0x168fe9e] SystemDictionary::resolve_or_fail(Symbol*, Handle, Handle, bool, Thread*)+0x1e
      V [libjvm.so+0xaf5fbb] ConstantPool::klass_at_impl(constantPoolHandle const&, int, bool, Thread*)+0x31b
      V [libjvm.so+0xe57b8f] InstanceKlass::nest_host(Thread*)+0xcf
      V [libjvm.so+0xe5800e] InstanceKlass::has_nestmate_access_to(InstanceKlass*, Thread*)+0x2e
      V [libjvm.so+0x1548fb2] Reflection::verify_field_access(Klass const*, Klass const*, Klass const*, AccessFlags, bool, bool)+0x2e2
      V [libjvm.so+0x11b96eb] LinkResolver::check_method_accessability(Klass*, Klass*, Klass*, methodHandle const&, Thread*)+0x6b
      V [libjvm.so+0x11ba65d] LinkResolver::resolve_method(LinkInfo const&, Bytecodes::Code, Thread*)+0x14d
      V [libjvm.so+0x11bbad3] LinkResolver::linktime_resolve_static_method(LinkInfo const&, Thread*)+0x63
      V [libjvm.so+0x11bbe62] LinkResolver::resolve_static_call(CallInfo&, LinkInfo const&, bool, Thread*)+0x32
      V [libjvm.so+0x11bf454] LinkResolver::resolve_static_call_or_null(LinkInfo const&)+0xb4
      V [libjvm.so+0x8f9b86] ciEnv::lookup_method(ciInstanceKlass*, ciKlass*, Symbol*, Symbol*, Bytecodes::Code, constantTag)+0x1d6
      V [libjvm.so+0x8fa0d2] ciEnv::get_method_by_index_impl(constantPoolHandle const&, int, Bytecodes::Code, ciInstanceKlass*)+0x1b2
      V [libjvm.so+0x8fa94e] ciEnv::get_method_by_index(constantPoolHandle const&, int, Bytecodes::Code, ciInstanceKlass*)+0x19e
      V [libjvm.so+0x96e1d5] ciBytecodeStream::get_method(bool&, ciSignature**)+0x335
      V [libjvm.so+0x7aa063] GraphBuilder::invoke(Bytecodes::Code)+0x33
      V [libjvm.so+0x7acd04] GraphBuilder::iterate_bytecodes_for_block(int)+0x1c14
      V [libjvm.so+0x7ad17f] GraphBuilder::iterate_all_blocks(bool)+0x9f
      V [libjvm.so+0x7ae24f] GraphBuilder::GraphBuilder(Compilation*, IRScope*)+0x38f
      V [libjvm.so+0x7b84d7] IRScope::IRScope(Compilation*, IRScope*, int, ciMethod*, int, bool)+0x277
      V [libjvm.so+0x7b9841] IR::IR(Compilation*, ciMethod*, int)+0x121
      V [libjvm.so+0x7810dd] Compilation::build_hir() [clone .part.116]+0x2fd
      V [libjvm.so+0x786cb8] Compilation::compile_java_method() [clone .part.117]+0xbf8
      V [libjvm.so+0x787377] Compilation::compile_method()+0x247
      V [libjvm.so+0x788cce] Compilation::Compilation(AbstractCompiler*, ciEnv*, ciMethod*, int, BufferBlob*, DirectiveSet*)+0x44e
      V [libjvm.so+0x78a04e] Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x17e
      V [libjvm.so+0xa87c9e] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x38e
      V [libjvm.so+0xa88891] CompileBroker::compiler_thread_loop()+0x241
      V [libjvm.so+0x16dd8ce] JavaThread::thread_main_inner()+0x22e
      V [libjvm.so+0x16ddb49] JavaThread::run()+0x1b9
      V [libjvm.so+0x1421c2a] thread_native_entry(Thread*)+0xfa

        Attachments

          Activity

            People

            • Assignee:
              dholmes David Holmes
              Reporter:
              dholmes David Holmes
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: