Java 7 paralyses Lucene and Solr
The hotspot compiler in the recently released Java 7 has a defective optimiser that can cause flawed loops, according to a warning published by the Apache Software Foundation. As a result, the Java Virtual Machine can crash, and calculations can produce incorrect results.
A number of Apache projects are affected, including every published version of Lucene and Solr. The Apache developers say that the indexing of documents on Solr causes Java to crash. Loops in Lucene can also be incorrectly compiled, thereby corrupting the indexes. In particular, the trunk version of Lucene with the pulsing codec is affected.
The bugs were discovered only five days before Java 7 was published; Oracle says it will correct them in the second service release of Java 7 at the latest; the first update to Java 7 was reserved solely for security fixes, but the issue may prompt Oracle to change that plan. Until then though, users of Lucene and Solr should refrain from using the new version of Java or at least use the JVM option
-XX:-UseLoopPredicate to disable the optimisation and prevent the index from being damaged.
The Apache developers say that users of Java 6 could also be affected. However, the flaws only occur in Java 6 when the JVM is used with the options
-XX:+AggressiveOpts which activate normally disabled Hotspot optimisations.
Oracle has registered the flaws under 7070134, 7044738 and 7068051. The first one causes JVM to crash when Martin Porter's stemmer algorithm is used, which traces English words back to their stems. This flaw currently is of "low priority" while the others are "medium".