JDK-8305797 : Assertion failure: dead loop detected
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11.0.18
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • OS: linux_ubuntu
  • CPU: x86_64
  • Submitted: 2023-04-03
  • Updated: 2023-04-10
Description
ADDITIONAL SYSTEM INFORMATION :
ARCH: x86_64
OS: Ubuntu 20.04.5 LTS
Javac: javac 11.0.19-internal
Java
- openjdk version "11.0.19-internal" 2023-04-18
- OpenJDK Runtime Environment (fastdebug build 11.0.19-internal+0-adhoc.simon.jdk11u-dev)
- OpenJDK 64-Bit Server VM (fastdebug build 11.0.19-internal+0-adhoc.simon.jdk11u-dev, mixed mode)


A DESCRIPTION OF THE PROBLEM :
The given test makes HotSpot crash with the following assertion failure:
```
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/simon/JVMs/jdk11u-dev/src/hotspot/share/opto/phaseX.cpp:955), pid=85742, tid=85759
#  assert(no_dead_loop) failed: dead loop detected
```

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. javac T.java
2. java T

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No crash
ACTUAL -
HotSpot crashed

---------- BEGIN SOURCE ----------
class T {
  static boolean r;

  void zoo() {
    int w, q = 140;
    int e, y, u = 25121;
    short s = 23261;
    for (w = 8; ; ++w) {
      r = w >= 171;
      if (r) {
        for (e = 1; e < 3; ) {
          try {
            y = q;
          } catch (ArithmeticException x) {
          }
          int m = e;
          try {
            int i, j, k, h;
            byte[] a = new byte[w];
            for (i = 14; 297 > i; ) for (int n = 151430; n < 235417; n += 2) {}
            for (j = 4; 179 > j; ++j)
              for (k = 1; k < 58; k++) for (h = k; 400 > h; ) j >>= e;
          } catch (Throwable x) {
          } finally {
          }
          if (r) break;
        }
      } else u += s;
    }
  }

  public static void main(String[] g) {
    new T().zoo();
  }
}
---------- END SOURCE ----------

FREQUENCY : always



Comments
Issue is not reproduced. Crash is not observed. OS: Windows 10 JDK 11.0.18: Pass JDK 17.0.6: Pass JDK 20: Pass JDK 21ea: Pass moving it to dev team for further analysis
10-04-2023