I did a fresh build of JDK7 on a freshly setup Debian box, tried to run Font2DTest and got the following exception:
Exception in thread "main" java.lang.StackOverflowError
at java.lang.ThreadLocal$ThreadLocalMap.getEntry(ThreadLocal.java:376)
at java.lang.ThreadLocal$ThreadLocalMap.access$000(ThreadLocal.java:261)
at java.lang.ThreadLocal.get(ThreadLocal.java:146)
at java.lang.StringCoding.deref(StringCoding.java:63)
at java.lang.StringCoding.encode(StringCoding.java:329)
at java.lang.String.getBytes(String.java:954)
at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:243)
at java.io.File.exists(File.java:774)
at sun.font.FcFontConfiguration.readFcInfo(FcFontConfiguration.java:423)
at sun.font.FcFontConfiguration.init(FcFontConfiguration.java:92)
at sun.font.FcFontConfiguration.<init>(FcFontConfiguration.java:74)
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:766)
at sun.font.SunFontManager$2.run(SunFontManager.java:423)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.SunFontManager.<init>(SunFontManager.java:368)
at sun.awt.X11FontManager.<init>(X11FontManager.java:32)
at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:539)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:86)
at sun.font.SunFontManager.getInstance(SunFontManager.java:242)
at sun.awt.X11FontManager.getInstance(X11FontManager.java:137)
at sun.font.FcFontConfiguration.readFcInfo(FcFontConfiguration.java:427)
at sun.font.FcFontConfiguration.init(FcFontConfiguration.java:92)
at sun.font.FcFontConfiguration.<init>(FcFontConfiguration.java:74)
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:766)
at sun.font.SunFontManager$2.run(SunFontManager.java:423)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.SunFontManager.<init>(SunFontManager.java:368)
at sun.awt.X11FontManager.<init>(X11FontManager.java:32)
at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:539)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:86)
at sun.font.SunFontManager.getInstance(SunFontManager.java:242)
at sun.awt.X11FontManager.getInstance(X11FontManager.java:137)
at sun.font.FcFontConfiguration.readFcInfo(FcFontConfiguration.java:427)
at sun.font.FcFontConfiguration.init(FcFontConfiguration.java:92)
at sun.font.FcFontConfiguration.<init>(FcFontConfiguration.java:74)
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:766)
at sun.font.SunFontManager$2.run(SunFontManager.java:423)
at java.security.AccessController.doPrivileged(Native Method)
at sun.font.SunFontManager.<init>(SunFontManager.java:368)
at sun.awt.X11FontManager.<init>(X11FontManager.java:32)
at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:539)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:86)
at sun.font.SunFontManager.getInstance(SunFontManager.java:242)
at sun.awt.X11FontManager.getInstance(X11FontManager.java:137)
at sun.font.FcFontConfiguration.readFcInfo(FcFontConfiguration.java:427)
at sun.font.FcFontConfiguration.init(FcFontConfiguration.java:92)
<ad infinitum>
This is caused by (what I call) initialization loop, where one constructor calls somehow calls another constructor, which somehow manages to call back into the first constructor.