Infloop in javac on invalid source

Martin Buchholz martinrb at google.com
Fri May 10 16:51:44 PDT 2013


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


More information about the jdk7-dev mailing list