Java 7 breaks Apache projects

On Thursday last week, Oracle released Java 7, following the launch event on the 7th.

Unfortunately, it turns out a rather serious issue with Hotspot, the code-name for the raft of optimisations added to Java's compiler for this release, may cause many issues for Java developers and users.

The issues relate to optimisations that the compiler makes when compiling certain types of loops. In some cases with Lucene, an Apache search indexing project, this can increase in severity from just crashing the JVM to data corruption and incorrect results.

"Unfortunately [Java 7] contains hotspot compiler optimizations, which miscompile some loops. This can affect code of several Apache projects. Sometimes JVMs only crash, but in several cases, results calculated can be incorrect, leading to bugs in applications", wrote Apache Software Foundation volunteer Uwe Schindler to the Lucene and Solr mailing lists. "Apache Lucene Core and Apache Solr are two Apache projects, which are affected by these bugs, namely all versions released until today."

"These problems were detected only 5 days before the official Java 7 release, so Oracle had no time to fix those bugs, affecting also many more applications."

Even at the Java 7 launch event, developers in large corporations with big interests in Java admitted that they may not migrate to Java 7 until at least Update 2. With this set-back affecting many popular projects, it looks likely that this migration will occur well after Update 2, in which the proposed fixes will be incorporated.

The issues are also present in Java 6, but only if the -XX:+OptimizeStringConcat or -XX:+AggressiveOpts compiler flags are enabled, which is not the case by default.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In theory, theory and practice are the same. In practice, they're not.”