今年遇到的幾個jdk的BUG,記錄。

1.  大量使用httpclient,遇到這個異常,還會致使咱們的resin服務器自動重啓:

A fatal error has been detected by the Java Runtime Environment:
SIGSEGV (0xb) at pc=0x00007fd211cbd1ee, pid=27875, tid=140532982884096
JRE version: 7.0_04-b20
Java VM: Java HotSpot(TM) 64-Bit Server VM (23.0-b21 mixed mode linux-amd64 compressed oops)
Problematic frame:
J  org.apache.http.impl.cookie.BestMatchSpec.formatCookies(Ljava/util/List;)Ljava/util/List;

java.util.NoSuchElementException: null
    at java.util.ArrayList$Itr.next(ArrayList.java:834) ~[na:1.7.0_51]
    at org.apache.http.impl.cookie.BestMatchSpec.formatCookies(BestMatchSpec.java:175) ~[httpclient-4.3.jar:4.3]
    at org.apache.http.client.protocol.RequestAddCookies.process(RequestAddCookies.java:174) ~[httpclient-4.3.jar:4.3]
    at org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:131) ~[httpcore-4.3.jar:4.3]
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:192) ~[httpclient-4.3.jar:4.3]
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:85) ~[httpclient-4.3.jar:4.3]
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108) ~[httpclient-4.3.jar:4.3]
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186) ~[httpclient-4.3.jar:4.3]
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) ~[httpclient-4.3.jar:4.3]
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106) ~[httpclient-4.3.jar:4.3]
    at module.laohu.commons.util.HttpClientUtil.invokePost(HttpClientUtil.java:209) [commons.laohu.module-2.2.jar:na]
    at module.laohu.commons.util.HttpClientUtil.invokePost(HttpClientUtil.java:168) [commons.laohu.module-2.2.jar:na]
    at com.general.sdk.channel.Nd91Handler.login(Nd91Handler.java:36) [Nd91Handler.class:na]
    at com.general.sdk.channel.Channel.login(Channel.java:103) [Channel.class:na]
    at com.general.sdk.manager.UserLoginManager.login(UserLoginManager.java:146) [UserLoginManager.class:na]
    at com.general.sdk.controller.UserController.login(UserController.java:48) [UserController.class:na]

此異常是因爲jdk  JIT compiler optimization 致使,bug id 8021898,官網描述以下:java

The JIT compiler optimization leads to a SIGSEGV or an NullPointerException at a place it must not happen.

jdk1.7.0_25到1.7.0_55這幾個版本都存在此bug,1.7.0_60後修復。可經過升級jdk解決此異常。linux

reference:apache

http://bugs.java.com/view_bug.do?bug_id=8021898 tomcat

https://issues.apache.org/jira/browse/HTTPCLIENT-1173 服務器

2.  JVM崩潰-safepoint.cpp:308:

tomcat使用一天左右就崩潰一次,tomcat目錄下產生一個hs_err * .log的日誌文件,裏面會記錄致使JVM崩潰的信息,這次致命錯誤關鍵信息爲【safepoint.cpp:308】,jdk版本從1.6更新到1.7解決cookie

{48016D14-124B-4BEE-A5C7-FCBE7AAEEA40}.png

相關文章
相關標籤/搜索