Compilation hangs for a class with field double d = 2.2250738585072012e-308

浪子不回头ぞ 提交于 2019-11-29 13:42:05
Joachim Sauer

It's a bug in the String-to-double conversion algorithm of the JVM: http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/

You can get the same hang if you try to parse that string at runtime. The compiler hangs because it uses the same code (it's a Java program after all).

Update: the issue now has a CVE identifier (CVE-2010-4476) and a patch (for Oracle JVMs, also works on OpenJDK).

According to the patch it all boils down to an off-by-one error.

This is a known issue which was in news a couple of days back. More info here.

This is an open bug for over 10 years. Bad Sun.

The fact that Java systems haven't been attacked and dead in masses proves that there are really very few naughty people on the earth.

Oracle has released a hot fix which can be found here:

http://www.oracle.com/technetwork/java/javase/fpupdater-tool-readme-305936.html

The hotfix will work for java 1.4, 1.5, and 1.6.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!