gpt4 book ai didi

crash - 如何在 jvm GCTaskThread 中调试 SIGSEGV

转载 作者:行者123 更新时间:2023-12-03 15:27:52 25 4
gpt4 key购买 nike

我的应用程序在生产中遇到现金。
故障转储表明 GCTaskThread 中发生了 SIGSEGV

它使用 JNI,所以可能有一些内存损坏的来源,尽管我不能确定。

我怎样才能调试这个问题 - 我虽然做了 -XX:OnError ......但我不确定什么能帮助我调试这个。

另外,你们中的一些人能否给出一个具体的例子,说明 JNI 代码如何使用 SIGSEGV 使 GC 崩溃

编辑 :

操作系统:SUSE Linux Enterprise Server 10 (x86_64)

vm_info:用于 linux-amd64 JRE (1.6.0_10-b33) 的 Java HotSpot(TM) 64 位服务器 VM (11.0-b15),构建于 2008 年 9 月 26 日 01:10:29 由“java_re”和 gcc 3.2.2 ( SuSE Linux)

编辑 :
禁用超线程后问题不再发生,有什么想法吗?

最佳答案

JNI 代码中的错误可能以多种方式发生:

The program crashes during execution of a native method (most common).
The program crashes some time after returning from the native method, often during GC (not so common).
Bad JNI code causes deadlocks shortly after returning from a native method (occasional).

如果您认为用户编写的 native 代码与 JVM 之间的交互存在问题(即 JNI 问题),您可以运行诊断程序来帮助您检查 JNI 转换。调用这些诊断;在启动 JVM 时指定 -Xcheck:jni 选项。

-Xcheck:jni 选项激活一组围绕 JNI 函数的包装函数。包装函数对传入的参数执行检查。这些检查包括:
Whether the call and the call that initialized JNI are on the same thread.
Whether the object parameters are valid objects.
Whether local or global references refer to valid objects.
Whether the type of a field matches the Get<Type>Field or Set<Type>Field call.
Whether static and nonstatic field IDs are valid.
Whether strings are valid and non-null.
Whether array elements are non-null.
The types on array elements.

请阅读以下链接
http://publib.boulder.ibm.com/infocenter/javasdk/v5r0/index.jsp?topic=/com.ibm.java.doc.diagnostics.50/html/jni_debug.html
http://www.oracle.com/technetwork/java/javase/clopts-139448.html#gbmtq

关于crash - 如何在 jvm GCTaskThread 中调试 SIGSEGV,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4645870/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com