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

Infloop in javac on invalid source

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 8
    • 8
    • tools
    • None

      From Martin Bucholz at google,
      Hi javac folk!

      This is a bug report for a serious bug: an infinite loop in javac that
      appears to have been introduced into jdk7 (also repro'd in dk8) relatively
      recently, as discovered by my colleague Raluca. She suspects this commit:

      http://hg.openjdk.java.net/jdk7u/jdk7u/langtools/rev/4baab658f357

      #!/bin/bash
      set -eu

      mkdir -p /tmp/t9/baz
      cd /tmp/t9

      cat > A.java <<'EOF'
      import java.util.Map;
      import java.util.Set;
      import baz.Baz;
      public class A {
         private static class Foo<M extends Map, S extends Set> extends Bar<M, S>
      {
             @Override void run() {}
         }
         private static class Bar<M extends Map, S extends Set> extends Baz<M, S>
      {
             @Override void run() { }
         }
      }
      EOF

      cat > baz/Baz.java <<'EOF'
      package baz;
      import java.util.Map;
      public class Baz <M extends Map> {
         void run() { }
      }
      EOF

      javac baz/Baz.java
      jar cvf libbaz.jar baz/Baz.class
      javac -cp libbaz.jar A.java

            mcimadamore Maurizio Cimadamore
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: