小心bug!慎用Java7

Java 7 GA 今天发布了,但是如Uwe Schindler 所述,HotSpot Loop optimizations存在一些非常可怕的默认启用的bug。***的情况下,这些bug会导致JVM崩溃,最坏的情况下,会导致loops的不正确的执行。

十载的潼关网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。全网营销推广的优势是能够根据用户设备显示端的尺寸不同,自动调整潼关建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。创新互联从事“潼关网站设计”,“潼关网站推广”以来,每个客户项目都认真落实执行。

除非,除非在你的Java代码里面不用任何的loops。

附 Uwe Schindler 的邮件:

From: Uwe Schindler

Date: Thu, 28 Jul 2011 23:13:36 +0200

Subject: [WARNING] Index corruption and crashes in Apache Lucene Core / Apache Solr with Java 7

Hello Apache Lucene & Apache Solr users,

Hello users of other Java-based Apache projects,

Oracle released Java 7 today. Unfortunately it 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 (see Hotspot

bugs 7070134 [1], 7044738 [2], 7068051 [3]).

Apache Lucene Core and Apache Solr are two Apache projects, which are

affected by these bugs, namely all versions released until today. Solr users

with the default configuration will have Java crashing with SIGSEGV as soon

as they start to index documents, as one affected part is the well-known

Porter stemmer (see LUCENE-3335 [4]). Other loops in Lucene may be

miscompiled, too, leading to index corruption (especially on Lucene trunk

with pulsing codec; other loops may be affected, too - LUCENE-3346 [5]).

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. In response to our questions, they proposed to include the

fixes into service release u2 (eventually into service release u1, see [6]).

This means you cannot use Apache Lucene/Solr with Java 7 releases before

Update 2! If you do, please don't open bug reports, it is not the

committers' fault! At least disable loop optimizations using the

-XX:-UseLoopPredicate JVM option to not risk index corruptions.

Please note: Also Java 6 users are affected, if they use one of those JVM

options, which are not enabled by default: -XX:+OptimizeStringConcat or

-XX:+AggressiveOpts

It is strongly recommended not to use any hotspot optimization switches in

any Java version without extensive testing!

In case you upgrade to Java 7, remember that you may have to reindex, as the

unicode version shipped with Java 7 changed and tokenization behaves

differently (e.g. lowercasing). For more information, read

JRE_VERSION_MIGRATION.txt in your distribution package!

On behalf of the Lucene project,

Uwe

[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7070134

[2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7044738

[3] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7068051

[4] https://issues.apache.org/jira/browse/LUCENE-3335

[5] https://issues.apache.org/jira/browse/LUCENE-3346

[6] http://s.apache.org/StQ

原文:http://www.oschina.net/news/20170/java7-bug

当前文章:小心bug!慎用Java7
文章URL:http://www.shufengxianlan.com/qtweb/news41/213191.html

网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联