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

[lworld] C2: Array loads and stores on inexact flat arrays cause crashes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • repo-valhalla
    • repo-valhalla
    • hotspot

      The attached test crashes with a segfault in TypeAryPtr::flat_log_elem_size().

      To reproduce:
      $ java --enable-preview --source 24 --add-exports java.base/jdk.internal.value=ALL-UNNAMED --add-exports java.base/jdk.internal.vm.annotation=ALL-UNNAMED Test.java && jfval --enable-preview --add-exports java.base/jdk.internal.value=ALL-UNNAMED --add-exports java.base/jdk.internal.vm.annotation=ALL-UNNAMED -Xcomp -XX:CompileOnly=Test*::test* Test

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0x00007694fe515750, pid=576208, tid=576222
      #
      # JRE version: Java(TM) SE Runtime Environment (24.0+1) (fastdebug build 24-valhalla+1-31)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 24-valhalla+1-31, compiled mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Problematic frame:
      # V [libjvm.so+0x1915750] TypeAryPtr::flat_log_elem_size() const+0x50
      ............
      Command Line: --enable-preview --add-exports=java.base/jdk.internal.value=ALL-UNNAMED --add-exports=java.base/jdk.internal.vm.annotation=ALL-UNNAMED -Xcomp -XX:CompileOnly=Test*::test* Test
      .............
      C2:160 64 b 4 Test::test (24 bytes)

      Stack: [0x000075deaca00000,0x000075deacb00000], sp=0x000075deacafc390, free space=1008k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x1915750] TypeAryPtr::flat_log_elem_size() const+0x50
      V [libjvm.so+0xe3d968] GraphKit::array_element_address(Node*, Node*, BasicType, TypeInt const*, Node*)+0x78
      V [libjvm.so+0x15fe305] Parse::array_addressing(BasicType, int, Type const*&)+0x395
      V [libjvm.so+0x15fea3f] Parse::array_load(BasicType)+0x3f
      V [libjvm.so+0x160f08e] Parse::do_one_bytecode()+0x74e
      V [libjvm.so+0x15f52aa] Parse::do_one_block()+0x20a
      V [libjvm.so+0x15f6766] Parse::do_all_blocks()+0x136
      V [libjvm.so+0x15fa4a2] Parse::Parse(JVMState*, ciMethod*, float)+0xe52
      V [libjvm.so+0x8b238c] ParseGenerator::generate(JVMState*)+0x16c
      V [libjvm.so+0xa7a861] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1841
      V [libjvm.so+0x8af952] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1f2
      V [libjvm.so+0xa86868] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x928
      V [libjvm.so+0xa874d8] CompileBroker::compiler_thread_loop()+0x458
      V [libjvm.so+0xf8107c] JavaThread::thread_main_inner()+0xcc
      V [libjvm.so+0x18e8256] Thread::call_run()+0xb6
      V [libjvm.so+0x15a9937] thread_native_entry(Thread*)+0x127

        1. hs_err_pid576754.log
          80 kB
          Christian Hagedorn
        2. Test.java
          0.9 kB
          Christian Hagedorn

            chagedorn Christian Hagedorn
            chagedorn Christian Hagedorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: