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

JVM 運行我的代碼時如何調(diào)試 Segfaults?

How do I debug Segfaults occurring in the JVM when it runs my code?(JVM 運行我的代碼時如何調(diào)試 Segfaults?)
本文介紹了JVM 運行我的代碼時如何調(diào)試 Segfaults?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

限時送ChatGPT賬號..

我的 Java 應(yīng)用程序已經(jīng)開始定期崩潰,出現(xiàn) SIGSEGV 和堆棧數(shù)據(jù)轉(zhuǎn)儲以及文本文件中的大量信息.

My Java application has started to crash regularly with a SIGSEGV and a dump of stack data and a load of information in a text file.

我在 gdb 中調(diào)試了 C 程序,并從我的 IDE 中調(diào)試了 Java 代碼.我不確定如何在正在運行的 Java 程序中處理類似 C 的崩潰.

I have debugged C programs in gdb and I have debugged Java code from my IDE. I'm not sure how to approach C-like crashes in a running Java program.

我假設(shè)我不是在這里查看 JVM 錯誤.其他 Java 程序運行良好,Sun 的 JVM 可能比我的代碼更穩(wěn)定.但是,我不知道我怎么會導(dǎo)致 Java 代碼出現(xiàn)段錯誤.肯定有足夠的可用內(nèi)存,當(dāng)我上次檢查分析器時,堆使用率約為 50%,偶爾峰值約為 80%.我可以調(diào)查任何啟動參數(shù)嗎?處理此類錯誤時,什么是好的清單?

I'm assuming I'm not looking at a JVM bug here. Other Java programs run just fine, and the JVM from Sun is probably more stable than my code. However, I have no idea how I could even cause segfaults with Java code. There definitely is enough memory available, and when I last checked in the profiler, heap usage was around 50% with occasional spikes around 80%. Are there any startup parameters I could investigate? What is a good checklist when approaching a bug like this?

雖然到目前為止我還不能可靠地重現(xiàn)該事件,但它似乎也不是完全隨機發(fā)生的,因此測試并非完全不可能.

Though I'm not so far able to reliably reproduce the event, it does not seem to occur entirely at random either, so testing is not completely impossible.

預(yù)計到達時間:一些血腥細(xì)節(jié)

(我正在尋找一種通用方法,因為實際問題可能非常具體.不過,我已經(jīng)收集了一些信息,這可能具有一定的價值.)

不久前,我在升級 CI 服務(wù)器后遇到了類似的問題(請參閱 這里了解更多詳細(xì)信息),但這次修復(fù)(設(shè)置 -XX:MaxPermSize)沒有幫助.

A while ago, I had similar-looking trouble after upgrading my CI server (see here for more details), but that fix (setting -XX:MaxPermSize) did not help this time.

進一步調(diào)查顯示,在崩潰日志文件中,標(biāo)記為當(dāng)前線程"的線程從來都不是我的線程,而是一個名為VMThread"或一個名為GCTaskThread"的線程——如果是后者,則另外標(biāo)記帶有注釋(退出)",如果是前者,則 GCTaskThread 不在列表中.這讓我認(rèn)為問題可能在 GC 操作結(jié)束時出現(xiàn).

Further investigation revealed that in the crash log files the thread marked as "current thread" is never one of mine, but either one called "VMThread" or one called "GCTaskThread"- I f it's the latter, it is additionally marked with the comment "(exited)", if it's the former, the GCTaskThread is not in the list. This makes me suppose that the problem might be around the end of a GC operation.

推薦答案

我假設(shè)我不是在這里查看 JVM 錯誤.其他 Java 程序運行得很好,Sun 的 JVM 可能比我的更穩(wěn)定代碼.

I'm assuming I'm not looking at a JVM bug here. Other Java programs run just fine, and the JVM from Sun is probably more stable than my code.

我認(rèn)為你不應(yīng)該做出這樣的假設(shè).如果不使用 JNI,您應(yīng)該無法編寫導(dǎo)致 SIGSEGV 的 Java 代碼(盡管我們知道它會發(fā)生).我的觀點是,當(dāng)它發(fā)生時,它要么是 JVM 中的錯誤(并非聞所未聞),要么是某些 JNI 代碼中的錯誤.如果您自己的代碼中沒有任何 JNI,這并不意味著您沒有使用某個庫,所以請尋找它.當(dāng)我以前看到這種問題時,它是在一個圖像處理庫中.如果罪魁禍?zhǔn)撞辉谀约旱?JNI 代碼中,您可能無法修復(fù)"該錯誤,但您仍然可以解決它.

I don't think you should make that assumption. Without using JNI, you should not be able to write Java code that causes a SIGSEGV (although we know it happens). My point is, when it happens, it is either a bug in the JVM (not unheard of) or a bug in some JNI code. If you don't have any JNI in your own code, that doesn't mean that you aren't using some library that is, so look for that. When I have seen this kind of problem before, it was in an image manipulation library. If the culprit isn't in your own JNI code, you probably won't be able to 'fix' the bug, but you may still be able to work around it.

首先,您應(yīng)該在同一平臺上獲得一個備用 JVM 并嘗試重現(xiàn)它.您可以嘗試這些替代方法之一.

First, you should get an alternate JVM on the same platform and try to reproduce it. You can try one of these alternatives.

如果您無法重現(xiàn)它,則可能是 JVM 錯誤.由此,您可以使用特定的 JVM 或搜索錯誤數(shù)據(jù)庫,使用您所知道的重現(xiàn)它,也許會得到建議的解決方法.(即使你可以重現(xiàn)它,許多 JVM 實現(xiàn)只是對 Oracle 的 Hotspot 實現(xiàn)的調(diào)整,所以它可能仍然是一個 JVM 錯誤.)

If you cannot reproduce it, it likely is a JVM bug. From that, you can either mandate a particular JVM or search the bug database, using what you know about how to reproduce it, and maybe get suggested workarounds. (Even if you can reproduce it, many JVM implementations are just tweaks on Oracle's Hotspot implementation, so it might still be a JVM bug.)

如果您可以使用替代 JVM 重現(xiàn)它,那么錯誤可能是您有一些 JNI 錯誤.查看您正在使用的庫以及它們可能進行的本機調(diào)用.有時,對于同一個庫或執(zhí)行幾乎相同操作的替代庫,有替代的純 Java"配置或 jar 文件.

If you can reproduce it with an alternative JVM, the fault might be that you have some JNI bug. Look at what libraries you are using and what native calls they might be making. Sometimes there are alternative "pure Java" configurations or jar files for the same library or alternative libraries that do almost the same thing.

祝你好運!

這篇關(guān)于JVM 運行我的代碼時如何調(diào)試 Segfaults?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 字符串本地日期時間,就像在 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)前星期幾的值)
主站蜘蛛池模板: 免费国产视频 | 精品一区二区三区入口 | 欧美不卡一区二区三区 | 黄色免费在线观看网站 | 久久精品国产一区 | 日本在线免费观看 | 一区二区精品在线 | 男人天堂99| 一级毛片在线播放 | 中文av在线播放 | 国产免费一区二区 | 欧美精品在线免费观看 | 久久久精选 | 国产综合视频 | 欧美区在线| 国产电影一区 | 91在线一区二区三区 | 亚洲 自拍 另类 欧美 丝袜 | 国产91丝袜在线18 | 国产精品一区二区无线 | 91av在线免费看 | 欧美日韩不卡 | 国产精品视频yy9299一区 | 人人爽人人草 | 国产欧美精品在线观看 | 欧美群妇大交群中文字幕 | 欧美一级片在线观看 | 欧美激情视频一区二区三区在线播放 | av色噜噜| 一区二区在线观看av | 久在线观看| 成人免费激情视频 | 日韩午夜在线播放 | 亚洲综合天堂 | 日韩国产欧美在线观看 | 国产精品一区二区视频 | 草久久| 1204国产成人精品视频 | 羞羞视频在线观看网站 | 国产欧美日韩综合精品一区二区 | 日韩一区二区在线视频 |