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

JVM 運行我的代碼時如何調試 Segfaults?

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

問題描述

限時送ChatGPT賬號..

我的 Java 應用程序已經開始定期崩潰,出現 SIGSEGV 和堆棧數據轉儲以及文本文件中的大量信息.

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 中調試了 C 程序,并從我的 IDE 中調試了 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.

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

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?

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

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.

預計到達時間:一些血腥細節

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

不久前,我在升級 CI 服務器后遇到了類似的問題(請參閱 這里了解更多詳細信息),但這次修復(設置 -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.

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

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.

推薦答案

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

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.

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

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.

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

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

如果您無法重現它,則可能是 JVM 錯誤.由此,您可以使用特定的 JVM 或搜索錯誤數據庫,使用您所知道的重現它,也許會得到建議的解決方法.(即使你可以重現它,許多 JVM 實現只是對 Oracle 的 Hotspot 實現的調整,所以它可能仍然是一個 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 重現它,那么錯誤可能是您有一些 JNI 錯誤.查看您正在使用的庫以及它們可能進行的本機調用.有時,對于同一個庫或執行幾乎相同操作的替代庫,有替代的純 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.

祝你好運!

這篇關于JVM 運行我的代碼時如何調試 Segfaults?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

Parsing an ISO 8601 string local date-time as if in UTC(解析 ISO 8601 字符串本地日期時間,就像在 UTC 中一樣)
How to convert Gregorian string to Gregorian Calendar?(如何將公歷字符串轉換為公歷?)
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 日之前日期的日歷到日期轉換.公歷到儒略歷切換)
java Calendar setFirstDayOfWeek not working(java日歷setFirstDayOfWeek不起作用)
Java: getting current Day of the Week value(Java:獲取當前星期幾的值)
主站蜘蛛池模板: 免费日韩av网站 | 中文字幕国产视频 | 欧美日韩国产综合在线 | 天天色天天色 | 视频一区二区中文字幕 | 免费h在线| 国产日韩精品在线 | 亚洲一区二区三区四区在线观看 | 青草福利| 一区二区中文 | 精品久久ai电影 | 免费黄色录像视频 | 91久久精品一区二区二区 | 久久久久久亚洲国产精品 | 中文字幕不卡 | www.日本在线播放 | 久久黄视频 | 妞干网av| 99久久免费精品国产免费高清 | k8久久久一区二区三区 | 成人免费小视频 | 国产福利一区二区 | 成人毛片视频免费 | 久草资源在线 | 国产精品视频在线播放 | 波多野结衣一二三区 | 免费在线观看av网址 | 黄篇网址| 欧美日韩精品免费 | 精品在线观看入口 | xx视频在线观看 | 在线成人免费视频 | 欧美精品久久久久 | 午夜精品久久久久久久星辰影院 | www.亚洲视频.com | 可以免费观看的av片 | 欧美电影免费观看 | 人妖videosex高潮另类 | 性高湖久久久久久久久 | 超碰人人做 | 91精品久久 |