久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

JVM 在 Lucene DataInput.readVInt 上崩潰

JVM crashes on Lucene DataInput.readVInt(JVM 在 Lucene DataInput.readVInt 上崩潰)
本文介紹了JVM 在 Lucene DataInput.readVInt 上崩潰的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

限時(shí)送ChatGPT賬號..

當(dāng)使用 Lucene 索引文檔時(shí),我的 JVM (1.6.0_29) 在密集使用時(shí)不斷崩潰.我明白了:

My JVM (1.6.0_29) keeps crashing on intensive use when indexing documents with Lucene. I get:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00002b6b196d767c, pid=26417, tid=1183217984
#
# JRE version: 6.0_29-b11
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.4-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# J  org.apache.lucene.store.DataInput.readVInt()I
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

環(huán)境:

JDK:1.6u29(與 1.6_02 相同的問題)Lucene 版本 3.4.0

JDK: 1.6u29 (same issue with 1.6_02) Lucene Version 3.4.0

vm_info:用于 linux-amd64 JRE (1.6.0_29-b11) 的 Java HotSpot(TM) 64 位服務(wù)器 VM (20.4-b02),由java_re"和 gcc 3.2 于 2011 年 10 月 3 日 01:19:20 構(gòu)建.2 (SuSE Linux)

vm_info: Java HotSpot(TM) 64-Bit Server VM (20.4-b02) for linux-amd64 JRE (1.6.0_29-b11), built on Oct 3 2011 01:19:20 by "java_re" with gcc 3.2.2 (SuSE Linux)

操作系統(tǒng):CentOS 5.0 版(最終版)

OS:CentOS release 5.0 (Final)

jvm_args: -Dcatalina.home=/var/local/tomcat-8081 -Dcatalina.base=/var/local/tomcat-8081 -Djava.io.tmpdir=/var/tmp -Dfile.encoding=UTF-8-Xmx1024M -XX:MaxPermSize=96m

jvm_args: -Dcatalina.home=/var/local/tomcat-8081 -Dcatalina.base=/var/local/tomcat-8081 -Djava.io.tmpdir=/var/tmp -Dfile.encoding=UTF-8 -Xmx1024M -XX:MaxPermSize=96m

這似乎是 jdk 1.7 中修復(fù)的 jdk 問題,但引入了其他問題.https://issues.apache.org/jira/browse/LUCENE-3335Java 7 包含自 1.6.0_21 以來對 readVInt 問題的修復(fù)(大約,LUCENE-2975)"

It seems to be a jdk issue that was fixed in jdk 1.7, but other issues where introduced. https://issues.apache.org/jira/browse/LUCENE-3335 "Java 7 contains a fix to the readVInt issue since 1.6.0_21 (approx, LUCENE-2975)"

那么,如何使用 JDK 1.6 解決這個(gè)問題?我應(yīng)該升級到 jdk 1.7 嗎?

So, how can I fix this issue using JDK 1.6? Should I upgrade to jdk 1.7?

推薦答案

這些 JDK 問題也在 1.6.9_29(不僅僅是 1.7.0u1)中得到修復(fù).ReadVInt 不能再崩潰.因此,您的崩潰與任何著名的 java6/7 錯(cuò)誤"都無關(guān)(vint 錯(cuò)誤根本不會(huì)使您的 JVM 崩潰,它只是通過返回錯(cuò)誤值來破壞您的索引 - 自 Lucene 3.1 以來這個(gè)問題肯定已修復(fù)).

these JDK issues are also fixed in 1.6.9_29 (not only 1.7.0u1). ReadVInt can no longer crash. So your crash is not related to any of the "famous java6/7 bugs" (the vint bug does not crash your JVM at all it just corrupts your index by returning wrong values - and this one is definitely fixed since Lucene 3.1).

但是還有另一個(gè)可能導(dǎo)致 JVM 崩潰:您在 64 位平臺(tái) (Linux) 上,因此默認(rèn)目錄實(shí)現(xiàn)是 MMapDirectory.Lucene 使用 hack 能夠從虛擬地址空間取消映射映射文件.JVM 本身不允許這樣做,但會(huì)使取消映射依賴于垃圾收集器,這對 Lucene 來說是個(gè)問題.默認(rèn)情況下,MMapDirectory 在關(guān)閉 IndexInputs 后取消映射文件.MMapDirectory 根本不同步,所以當(dāng)另一個(gè)線程在取消映射后嘗試訪問 IndexInput 時(shí),它將訪問一個(gè)未映射的地址并會(huì) SIGSEGV.

But there is another chance you can crash your JVM: You are on a 64 bit platform (Linux), so the default directory implementation is MMapDirectory. Lucene uses a hack to be able to unmap mapped files from virtual address space. This is not allowed by the JVM itsself, but makes unmapping dependent on garbage collector, which is a problem for Lucene. By default MMapDirectory unmaps the files after closing the IndexInputs. MMapDirectory is not synchronized at all, so when another thread tries to access the IndexInput after unmapping it will access an unmapped address and will SIGSEGV.

如果您的代碼正確,這不會(huì)發(fā)生,但看起來您正在使用已經(jīng)關(guān)閉的 IndexReader/IndexWriter 來訪問索引.在 Lucene 3.5(即將推出)之前,IndexReader 中缺少檢查將導(dǎo)致已關(guān)閉的 IndexReader 及其所有已關(guān)閉(且未映射)的 IndexInputs 嘗試訪問索引數(shù)據(jù)和段錯(cuò)誤.

If your code would be correct this cannot happen, but it looks like you are using an already closed IndexReader/IndexWriter to access the index. Before Lucene 3.5 (will come out soon), missing checks in IndexReader will make it possible that an already closed IndexReader with all its closed (and unmapped) IndexInputs tries to access index data and segfaults.

在 3.5 中,我們添加了額外的安全檢查來防止這種非法訪問,但它不是 100%(因?yàn)槿鄙偻?.我會(huì)查看代碼并檢查是否沒有任何內(nèi)容可以訪問已關(guān)閉的索引.

In 3.5 we added additional safety checks to prevent this illegal access, but its not 100% (as synchronization is missing). I would review the code and check that nothing accesses closed index.

檢查這是否是您的問題的簡單檢查是使用 NIOFSDirectory(在 Linux 上較慢)而不是 MMapDirectory.如果它沒有崩潰并且可能拋出 AlreadyClosedExceptions,則該錯(cuò)誤正在訪問已關(guān)閉的索引.

A simple check to see if this is your issue would be to use NIOFSDirectory (slower on Linux) instead of MMapDirectory. If it does not crash and possibly throws AlreadyClosedExceptions, the bug is accessing closed indexes.

這篇關(guān)于JVM 在 Lucene DataInput.readVInt 上崩潰的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Parsing an ISO 8601 string local date-time as if in UTC(解析 ISO 8601 字符串本地日期時(shí)間,就像在 UTC 中一樣)
How to convert Gregorian string to Gregorian Calendar?(如何將公歷字符串轉(zhuǎn)換為公歷?)
Java: What/where are the maximum and minimum values of a GregorianCalendar?(Java:GregorianCalendar 的最大值和最小值是什么/在哪里?)
Calendar to Date conversion for dates before 15 Oct 1582. Gregorian to Julian calendar switch(1582 年 10 月 15 日之前日期的日歷到日期轉(zhuǎn)換.公歷到儒略歷切換)
java Calendar setFirstDayOfWeek not working(java日歷setFirstDayOfWeek不起作用)
Java: getting current Day of the Week value(Java:獲取當(dāng)前星期幾的值)
主站蜘蛛池模板: 福利网站在线观看 | 中国农村毛片免费播放 | av网站免费看 | 欧美美女一区二区 | 天天插天天干 | 精品一区av | 日韩伦理视频 | 91成人精品| 日韩精品一区二区三区免费视频 | 色午夜| 国产视频一区二区在线 | 在线观看小视频 | 国产精品黄色 | 亚洲成人黄色 | 久久er99热精品一区二区 | 4hu在线 | 日本免费中文字幕 | 黄色录像免费看 | 国产又粗又大又硬 | 中文字幕在线一区二区三区 | 国产精品美女久久 | 国产精品海角社区 | 999久久久精品 | 国产1级片| 香蕉伊人网 | av基地网 | 毛片视频免费观看 | 亚洲欧美日韩成人 | 天天干天天操天天插 | 亚洲欧美在线一区 | 成人一级视频 | 久久视频一区二区 | 欧美在线a | 免费黄色一级视频 | 成人免费看片视频 | 国产成人精品一区二区三区视频 | 成年女人毛片 | 欧美日韩亚洲另类 | 又大又黄又爽 | 欧美性生交xxxxx久久久 | 黄色一级视频在线观看 |