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

WB_EnqueueInitializerForCompilation fails with "method holder must be initialized" when called for uninitialized class

XMLWordPrintable

    • b21

      The attached JTreg test "Test.java" fails with the assertion below due to trying to compile <clinit> for the uninitialized class "LongWrapper". This seems like a special case related to the WhiteBox usage of WB_EnqueueInitializerForCompilation and should not happen otherwise.

      -------------
      Original report for Valhalla:

      compiler/valhalla/inlinetypes/TestLWorldCrash.java ported to new IR framework started to crash with

      lworld bits crash with

      # Internal Error (/home/katya/work/JavaSE/Hotspot/ws/git/valhalla.chhagedorn/open/src/hotspot/share/compiler/compileBroker.cpp:1384), pid=30627, tid=30630
      # assert(!method->method_holder()->is_not_initialized()) failed: method holder must be initialized
      #
      # JRE version: Java(TM) SE Runtime Environment (17.0) (fastdebug build 17-lworld3ea+0-2021-03-16-2108446.katya...)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 17-lworld3ea+0-2021-03-16-2108446.katya..., mixed mode, sharing, tiered, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0xa5e484] CompileBroker::compile_method(methodHandle const&, int, int, methodHandle const&, int, CompileTask::CompileReason, DirectiveSet*, Thread*)+0x2d4
      #
      # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /home/katya

      --------------- S U M M A R Y ------------

      Command Line: -Djava.library.path=/home/katya/work/JavaSE/Hotspot/ws/git/valhalla.chhagedorn/build/linux-x64/images/test/hotspot/jtreg/native -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Djavatest.maxOutputSize=1000000 -XX:-UseACmpProfile -XX:-UseCompressedOops -XX:FlatArrayElementMaxOops=0 -XX:FlatArrayElementMaxSize=0 -XX:-UseArrayLoadStoreProfile -XX:InlineFieldMaxFlatSize=-1 -XX:+InlineTypePassFieldsAsArgs -XX:+InlineTypeReturnedAsFields -XX:+StressInlineTypeReturnedAsFields -DVerifyIR=false -XX:-BackgroundCompilation -XX:CompileCommand=quiet -DShouldDoIRVerification=false -DWarmup=251 jdk.test.lib.hotspot.ir_framework.TestFrameworkExecution compiler.valhalla.inlinetypes.TestLWorldCrash compiler.valhalla.inlinetypes.MyValue1 compiler.valhalla.inlinetypes.MyValue2 compiler.valhalla.inlinetypes.MyValue2Inline compiler.valhalla.inlinetypes.MyValue3 compiler.valhalla.inlinetypes.MyValue3Inline

      Host: olegbox, Intel(R) Xeon(R) CPU E5-2630 0 @ 2.30GHz, 24 cores, 15G, Ubuntu 16.04.6 LTS
      Time: Mon Mar 29 13:14:04 2021 PDT elapsed time: 1.559626 seconds (0d 0h 0m 1s)

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

      Current thread (0x00007fb044028f20): JavaThread "main" [_thread_in_vm, id=30630, stack(0x00007fb04b2f9000,0x00007fb04b3fa000)]

      Stack: [0x00007fb04b2f9000,0x00007fb04b3fa000], sp=0x00007fb04b3f83d0, free space=1020k
      Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0xa5e484] CompileBroker::compile_method(methodHandle const&, int, int, methodHandle const&, int, CompileTask::CompileReason, DirectiveSet*, Thread*)+0x2d4
      V [libjvm.so+0xa5eb12] CompileBroker::compile_method(methodHandle const&, int, int, methodHandle const&, int, CompileTask::CompileReason, Thread*)+0x82
      V [libjvm.so+0x1a7e834] WhiteBox::compile_method(Method*, int, int, Thread*)+0xc4
      V [libjvm.so+0x1a7ef7f] WB_EnqueueInitializerForCompilation+0x1bf
      j sun.hotspot.WhiteBox.enqueueInitializerForCompilation0(Ljava/lang/Class;I)Z+0
      j sun.hotspot.WhiteBox.enqueueInitializerForCompilation(Ljava/lang/Class;I)Z+8
      j jdk.test.lib.hotspot.ir_framework.TestFrameworkExecution.applyClassAnnotations(Ljava/lang/Class;)V+71
      j jdk.test.lib.hotspot.ir_framework.TestFrameworkExecution.processControlAnnotations(Ljava/lang/Class;)V+55
      j jdk.test.lib.hotspot.ir_framework.TestFrameworkExecution.parseTests()V+51
      j jdk.test.lib.hotspot.ir_framework.TestFrameworkExecution.start()V+1
      j jdk.test.lib.hotspot.ir_framework.TestFrameworkExecution.main([Ljava/lang/String;)V+55
      v ~StubRoutines::call_stub
      V [libjvm.so+0xed2c09] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x4e9
      V [libjvm.so+0x1010de9] jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) [clone .constprop.1]+0x369
      V [libjvm.so+0x10153a5] jni_CallStaticVoidMethod+0x1c5
      C [libjli.so+0x47d4] JavaMain+0xd34
      C [libjli.so+0x7db9] ThreadJavaMain+0x9

      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j sun.hotspot.WhiteBox.enqueueInitializerForCompilation0(Ljava/lang/Class;I)Z+0
      j sun.hotspot.WhiteBox.enqueueInitializerForCompilation(Ljava/lang/Class;I)Z+8
      j jdk.test.lib.hotspot.ir_framework.TestFrameworkExecution.applyClassAnnotations(Ljava/lang/Class;)V+71
      j jdk.test.lib.hotspot.ir_framework.TestFrameworkExecution.processControlAnnotations(Ljava/lang/Class;)V+55
      j jdk.test.lib.hotspot.ir_framework.TestFrameworkExecution.parseTests()V+51
      j jdk.test.lib.hotspot.ir_framework.TestFrameworkExecution.start()V+1
      j jdk.test.lib.hotspot.ir_framework.TestFrameworkExecution.main([Ljava/lang/String;)V+55
      v ~StubRoutines::call_stub


      To reproduce do:
      > clone Cristian's branch:
        https://github.com/openjdk/valhalla/compare/lworld...chhagedorn:TestingFramework

      > put attached TestLWorldCrash.java under test/hotspot/jtreg/compiler/valhalla/inlinetypes

      > run as any jtreg test (uoi can use JVM from master valhalla bits as well)

        1. hs_err_bug8264395.log
          69 kB
        2. hs_err_Test.log
          77 kB
        3. Test.java
          0.8 kB
        4. TestLWorldCrash.java
          8 kB

            rraghavan Rahul Raghavan
            epavlova Ekaterina Pavlova
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: