如何在 jvm GCTaskThread 中调试 SIGSEGV [英] how to debug SIGSEGV in jvm GCTaskThread

查看:15
本文介绍了如何在 jvm GCTaskThread 中调试 SIGSEGV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

My application is experiencing cashes in production. The crash dump indicates a SIGSEGV has occurred in GCTaskThread

它使用 JNI,所以可能有一些内存损坏的来源,虽然我不能确定.

It uses JNI, so there might be some source for memory corruption, although I can't be sure.

我该如何调试这个问题 - 我虽然想做 -XX:OnError... 但我不确定什么可以帮助我调试这个问题.

How can I debug this problem - I though of doing -XX:OnError... but i am not sure what will help me debug this.

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

Also, can some of you give a concrete example on how JNI code can crash GC with SIGSEGV

编辑:

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

OS: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),由java_re"和 gcc 3.2 于 2008 年 9 月 26 日 01:10:29 构建.2 (SuSE Linux)

vm_info: Java HotSpot(TM) 64-Bit Server VM (11.0-b15) for linux-amd64 JRE (1.6.0_10-b33), built on Sep 26 2008 01:10:29 by "java_re" with gcc 3.2.2 (SuSE Linux)

编辑:在我们禁用超线程后问题停止发生,有什么想法吗?

EDIT: The issue stop occurring after we disable the hyper threading, any thoughts?

推荐答案

JNI 代码中的错误可能有多种方式:

Errors in JNI code can occur in several ways:

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).

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

If you think that you have a problem with the interaction between user-written native code and the JVM (that is, a JNI problem), you can run diagnostics that help you check the JNI transitions. to invoke these diagnostics; specify the -Xcheck:jni option when you start up the JVM.

-Xcheck:jni 选项激活一组围绕 JNI 函数的包装函数.包装函数对传入参数执行检查.这些检查包括:

The -Xcheck:jni option activates a set of wrapper functions around the JNI functions. The wrapper functions perform checks on the incoming parameters. These checks include:

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.htmlhttp://www.oracle.com/technetwork/java/javase/clopts-139448.html#gbmtq

Pls read the following links 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

这篇关于如何在 jvm GCTaskThread 中调试 SIGSEGV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆