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

BoxLockNode creation fails with assert(reg < CHUNK_SIZE) failed: sanity

XMLWordPrintable

    • b08

        # Failure analysis
        The synchronized statements result in BoxLockNodes in C2, which require a stack slot and corresponding RegMask. When there is no more space on the stack (or, rather, when the RegMask cannot represent the too large stack slot), the assert triggers.

        # Original description
        C2 fails to compile deeply nested synchronized statements (see also related javac bug JDK-8322992).

        java -XX:CompileCommand=compileonly,C2Bug::* -XX:CompileCommand=quiet -XX:-TieredCompilation -Xcomp C2Bug.java

        # A fatal error has been detected by the Java Runtime Environment:
        #
        # Internal Error (/workspace/open/src/hotspot/share/opto/regmask.hpp:298), pid=3564487, tid=3564501
        # assert(reg < CHUNK_SIZE) failed: sanity
        #
        # JRE version: Java(TM) SE Runtime Environment (23.0+1) (fastdebug build 23-cpu+1-1)
        # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 23-cpu+1-1, compiled mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
        # Problematic frame:
        # V [libjvm.so+0x124767b] BoxLockNode::BoxLockNode(int)+0x86b

        Current CompileTask:
        C2:1461 82 !b C2Bug::test (1909 bytes)

        Stack: [0x00007fda0e5a5000,0x00007fda0e6a6000], sp=0x00007fda0e6a2610, free space=1013k
        Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
        V [libjvm.so+0x124767b] BoxLockNode::BoxLockNode(int)+0x86b (regmask.hpp:298)
        V [libjvm.so+0xd981de] GraphKit::shared_lock(Node*)+0x8e
        V [libjvm.so+0x150a0a6] Parse::do_one_bytecode()+0x2ca6
        V [libjvm.so+0x14f54af] Parse::do_one_block()+0x23f
        V [libjvm.so+0x14f6975] Parse::do_all_blocks()+0x135
        V [libjvm.so+0x14fab3d] Parse::Parse(JVMState*, ciMethod*, float)+0xb2d
        V [libjvm.so+0x840d29] ParseGenerator::generate(JVMState*)+0x169
        V [libjvm.so+0x9f1b9e] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x163e
        V [libjvm.so+0x83e5d7] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1e7
        V [libjvm.so+0x9fd92c] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x92c
        V [libjvm.so+0x9fe5b8] CompileBroker::compiler_thread_loop()+0x468
        V [libjvm.so+0xeb8eec] JavaThread::thread_main_inner()+0xcc
        V [libjvm.so+0x179e4d6] Thread::call_run()+0xb6
        V [libjvm.so+0x14a87a7] thread_native_entry(Thread*)+0x127

          1. C2Bug.java
            6 kB
          2. hs_err_pid3565397.log
            77 kB
          3. replay_pid3565397.log
            232 kB

              dlunden Daniel Lunden
              thartmann Tobias Hartmann
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: