JDK-8316954 : crash with Problematic frame: # V [libjvm.so+0x3ba568] AddPNode::bottom_type() const+0x158
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2023-09-25
  • Updated: 2023-09-26
Description
ADDITIONAL SYSTEM INFORMATION :
# JRE version: OpenJDK Runtime Environment (8.0_392) (build 1.8.0_392-internal-fastdebug--b00)
# Java VM: OpenJDK 64-Bit Server VM (25.392-b00-fastdebug mixed mode linux-amd64 compressed oops)

A DESCRIPTION OF THE PROBLEM :
I ran a regression test on jdk8u392, and I found a crash without any options.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
java compiler.loopopts.FillArrayWithUnsafe

ACTUAL -
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007ff1c33da568, pid=34634, tid=0x00007ff0aa858700
#
# JRE version: OpenJDK Runtime Environment (8.0_392) (build 1.8.0_392-internal-fastdebug--b00)
# Java VM: OpenJDK 64-Bit Server VM (25.392-b00-fastdebug mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x3ba568]  AddPNode::bottom_type() const+0x158
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home//repository//toreport/FillArrayWithUnsafe_09_24_01_27_02/hs_err_pid34634.log
#
# Compiler replay data is saved as:
# /home//repository/toreport/FillArrayWithUnsafe_09_24_01_27_02/replay_pid34634.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

---------- BEGIN SOURCE ----------
import java.lang.reflect.Field;

import sun.misc.Unsafe;

public class FillArrayWithUnsafe {

    private static Unsafe unsafe;

    public static void main(String[] args) throws Exception {
        Class klass = Unsafe.class;
        Field field = klass.getDeclaredField("theUnsafe");
        field.setAccessible(true);
        unsafe = (Unsafe) field.get(null);

        byte[] buffer;
        // Make sure method newByteArray is compiled by C2
        for (int i = 0; i < 50000; i++) {
            buffer = newByteArray(100, (byte) 0x80);
        }
    }

    public static byte[] newByteArray(int size, byte val) {
        byte[] arr = new byte[size];
        int offset = unsafe.arrayBaseOffset(byte[].class);
        for (int i = offset; i < offset + size; i++) {
             unsafe.putByte(arr, i, val);
        }
        return arr;
    }
}
---------- END SOURCE ----------

FREQUENCY : always



Comments
Issue is reproduced. Crash is observed on JDK 8 OS: Windows 10 JDK 8u381: Fail JDK 8u381 Fastdebug: Fail JDK 11.0.20 : Pass JDK 17.0.8 : Pass JDK 21 : Pass ILW = Crash, reproducible on GA build, no known workaround yet = MLM = P4 Moving it to dev team for further analysis
26-09-2023