使用gdb调试JDK9 Hotspot,导致eclipse / Ubuntu终端出现SIGSEGV Segmentation故障 [英] JDK9 Hotspot debug using gdb, causing SIGSEGV Segmentation fault in eclipse/Ubuntu terminal

查看:199
本文介绍了使用gdb调试JDK9 Hotspot,导致eclipse / Ubuntu终端出现SIGSEGV Segmentation故障的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试调试JDK9。

I am trying to debug JDK9.

我想跟踪源代码并查看JDK / Hotspot代码的控制流。

I want to trace source code and see the control flow of JDK/Hotspot code.

我使用gdb和Eclipse但有一个问题 SIGSEGV分段错误

I use gdb and Eclipse but there is a problem SIGSEGV Segmentation fault.

我从JDK官方文档中按照Buildme.md配置JDK9,

I follow Buildme.md from JDK official document to configure JDK9,

bash ./configure --with-debug-level=slowdebug --with-target-bits=64
--disable-warnings-as-errors

然后,

make all

我得到我的自定义调试版本:

I get my customized debug version:

/images/jdk/bin/java -version openjdk version "9-internal" 
OpenJDK Runtime Environment (build 9-internal+0-adhoc.xfwu.9dev) 
OpenJDK 64-Bit Server VM (build 9-internal+0-adhoc.xfwu.9dev, mixed mode)






以下代码段显示我使用HelloWorld.java来调试代码。我启动 gdb。乍一看似乎很好。但是,当该程序开始运行 thread 2 时,会引发 SIGSEGV Segmentation fault 的问题。我不知道为什么以及如何解决它。同样,我使用Eclipse进行调试,实际上,它与gdb没什么不同。从根本上说,他们都使用gdb。然后我得到同样的问题。


The following snippet shows that I use a HelloWorld.java to debug code. I start the gdb. It seems well at the first glance. However, when this program starts to run thread 2, it raises problem of SIGSEGV Segmentation fault. I don't know why and how to solve it. Similarly, I use Eclipse to debug, actually, it is no different from gdb. Fundamentally, they all use gdb. Then I get the same problem.

Thread 2 "java" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fc8700 (LWP 24030)]
0x00007fffe0dde513 in ?? ()
(gdb) info thread
  Id   Target Id         Frame 
  1    Thread 0x7ffff7fc9700 (LWP 24012) "java" 0x00007ffff71c99cd in pthread_join (threadid=140737353910016, thread_return=0x7fffffffb5e8) at pthread_join.c:90
* 2    Thread 0x7ffff7fc8700 (LWP 24030) "java" 0x00007fffe0dde513 in ?? ()






所有gdb信息:




All gdb info:

xfwu:~/sandboxJDK/9jdk/build/linux-x86_64-normal-server-slowdebug/jdk/bin$gdb --args java ~/sanboxJDK/9jdk/javaPrj/HelloWorld
GNU gdb (Ubuntu 7.11.90.20161005-0ubuntu1) 7.11.90.20161005-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from java...done.
(gdb) start
Temporary breakpoint 1 at 0xbbf: file /home/xfwu/sandboxJDK/9jdk/jdk/src/java.base/share/native/launcher/main.c, line 95.
Starting program: /home/xfwu/sandboxJDK/9jdk/build/linux-x86_64-normal-server-slowdebug/jdk/bin/java /home/xfwu/sanboxJDK/9jdk/javaPrj/HelloWorld
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Temporary breakpoint 1, main (argc=2, argv=0x7fffffffe9c8) at /home/xfwu/sandboxJDK/9jdk/jdk/src/java.base/share/native/launcher/main.c:95
95  {
(gdb) list
90      __initenv = _environ;
91  
92  #else /* JAVAW */
93  int
94  main(int argc, char **argv)
95  {
96      int margc;
97      char** margv;
98      const jboolean const_javaw = JNI_FALSE;
99  #endif /* JAVAW */
(gdb) 
100 
101     JLI_InitArgProcessing(!HAS_JAVA_ARGS, const_disable_argfile);
102 
103 #ifdef _WIN32
104     {
105         int i = 0;
106         if (getenv(JLDEBUG_ENV_ENTRY) != NULL) {
107             printf("Windows original main args:\n");
108             for (i = 0 ; i < __argc ; i++) {
109                 printf("wwwd_args[%d] = %s\n", i, __argv[i]);
(gdb) 
110             }
111         }
112     }
113     JLI_CmdToArgs(GetCommandLine());
114     margc = JLI_GetStdArgc();
115     // add one more to mark the end
116     margv = (char **)JLI_MemAlloc((margc + 1) * (sizeof(char *)));
117     {
118         int i = 0;
119         StdArg *stdargs = JLI_GetStdArgs();
(gdb) 
120         for (i = 0 ; i < margc ; i++) {
121             margv[i] = stdargs[i].arg;
122         }
123         margv[i] = NULL;
124     }
125 #else /* *NIXES */
126     {
127         // accommodate the NULL at the end
128         JLI_List args = JLI_List_new(argc + 1);
129         int i = 0;
(gdb) 
130 
131         // Add first arg, which is the app name
132         JLI_List_add(args, JLI_StringDup(argv[0]));
133         // Append JDK_JAVA_OPTIONS
134         if (JLI_AddArgsFromEnvVar(args, JDK_JAVA_OPTIONS)) {
135             // JLI_SetTraceLauncher is not called yet
136             // Show _JAVA_OPTIONS content along with JDK_JAVA_OPTIONS to aid diagnosis
137             if (getenv(JLDEBUG_ENV_ENTRY)) {
138                 char *tmp = getenv("_JAVA_OPTIONS");
139                 if (NULL != tmp) {
(gdb) 
140                     JLI_ReportMessage(ARG_INFO_ENVVAR, "_JAVA_OPTIONS", tmp);
141                 }
142             }
143         }
144         // Iterate the rest of command line
145         for (i = 1; i < argc; i++) {
146             JLI_List argsInFile = JLI_PreprocessArg(argv[i]);
147             if (NULL == argsInFile) {
148                 JLI_List_add(args, JLI_StringDup(argv[i]));
149             } else {
(gdb) 
150                 int cnt, idx;
151                 cnt = argsInFile->size;
152                 for (idx = 0; idx < cnt; idx++) {
153                     JLI_List_add(args, argsInFile->elements[idx]);
154                 }
155                 // Shallow free, we reuse the string to avoid copy
156                 JLI_MemFree(argsInFile->elements);
157                 JLI_MemFree(argsInFile);
158             }
159         }
(gdb) 
160         margc = args->size;
161         // add the NULL pointer at argv[argc]
162         JLI_List_add(args, NULL);
163         margv = args->elements;
164     }
165 #endif /* WIN32 */
166     return JLI_Launch(margc, margv,
167                    sizeof(const_jargs) / sizeof(char *), const_jargs,
168                    0, NULL,
169                    VERSION_STRING,
(gdb) 
170                    DOT_VERSION,
171                    (const_progname != NULL) ? const_progname : *margv,
172                    (const_launcher != NULL) ? const_launcher : *margv,
173                    HAS_JAVA_ARGS,
174                    const_cpwildcard, const_javaw, 0);
175 }
(gdb) 
Line number 176 out of range; /home/xfwu/sandboxJDK/9jdk/jdk/src/java.base/share/native/launcher/main.c has 175 lines.
(gdb) 
Line number 176 out of range; /home/xfwu/sandboxJDK/9jdk/jdk/src/java.base/share/native/launcher/main.c has 175 lines.
(gdb) 
Line number 176 out of range; /home/xfwu/sandboxJDK/9jdk/jdk/src/java.base/share/native/launcher/main.c has 175 lines.
(gdb) 
Line number 176 out of range; /home/xfwu/sandboxJDK/9jdk/jdk/src/java.base/share/native/launcher/main.c has 175 lines.
(gdb) s
98      const jboolean const_javaw = JNI_FALSE;
(gdb) 
101     JLI_InitArgProcessing(!HAS_JAVA_ARGS, const_disable_argfile);
(gdb) 
128         JLI_List args = JLI_List_new(argc + 1);
(gdb) 
129         int i = 0;
(gdb) 
132         JLI_List_add(args, JLI_StringDup(argv[0]));
(gdb) 
134         if (JLI_AddArgsFromEnvVar(args, JDK_JAVA_OPTIONS)) {
(gdb) 
145         for (i = 1; i < argc; i++) {
(gdb) 
146             JLI_List argsInFile = JLI_PreprocessArg(argv[i]);
(gdb) 
147             if (NULL == argsInFile) {
(gdb) 
148                 JLI_List_add(args, JLI_StringDup(argv[i]));
(gdb) 
145         for (i = 1; i < argc; i++) {
(gdb) 
160         margc = args->size;
(gdb) 
162         JLI_List_add(args, NULL);
(gdb) 
163         margv = args->elements;
(gdb) 
166     return JLI_Launch(margc, margv,
(gdb) 
172                    (const_launcher != NULL) ? const_launcher : *margv,
(gdb) 
166     return JLI_Launch(margc, margv,
(gdb) 
171                    (const_progname != NULL) ? const_progname : *margv,
(gdb) 
166     return JLI_Launch(margc, margv,
(gdb) 
[New Thread 0x7ffff7fc8700 (LWP 24030)]

Thread 2 "java" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fc8700 (LWP 24030)]
0x00007fffe0dde513 in ?? ()
(gdb) info thread
  Id   Target Id         Frame 
  1    Thread 0x7ffff7fc9700 (LWP 24012) "java" 0x00007ffff71c99cd in pthread_join (threadid=140737353910016, thread_return=0x7fffffffb5e8) at pthread_join.c:90
* 2    Thread 0x7ffff7fc8700 (LWP 24030) "java" 0x00007fffe0dde513 in ?? ()
(gdb) thread 1
[Switching to thread 1 (Thread 0x7ffff7fc9700 (LWP 24012))]
#0  0x00007ffff71c99cd in pthread_join (threadid=140737353910016, thread_return=0x7fffffffb5e8) at pthread_join.c:90
90  pthread_join.c: No such file or directory.
(gdb) n
[New Thread 0x7fffe0c0d700 (LWP 24038)]
[New Thread 0x7fffe0b0c700 (LWP 24039)]
[New Thread 0x7fffe0a0b700 (LWP 24040)]
[New Thread 0x7fffe090a700 (LWP 24041)]
[New Thread 0x7fffe0809700 (LWP 24042)]
[New Thread 0x7fffe0708700 (LWP 24043)]
[New Thread 0x7fffe0607700 (LWP 24044)]
[New Thread 0x7fffe0506700 (LWP 24045)]
[New Thread 0x7fffe0405700 (LWP 24046)]
[New Thread 0x7fffe0304700 (LWP 24047)]
[New Thread 0x7fffe0203700 (LWP 24048)]
[New Thread 0x7fffe0102700 (LWP 24049)]
[New Thread 0x7fffb3fff700 (LWP 24050)]
[New Thread 0x7fffb3efe700 (LWP 24051)]
[New Thread 0x7fffb3dfd700 (LWP 24052)]
[New Thread 0x7fffb3cfc700 (LWP 24053)]
[New Thread 0x7fffb3bfb700 (LWP 24054)]
[New Thread 0x7fffb3afa700 (LWP 24055)]
[New Thread 0x7fffb39f9700 (LWP 24056)]
[New Thread 0x7fffb38f8700 (LWP 24057)]
[New Thread 0x7fffb37f7700 (LWP 24058)]
[New Thread 0x7fffb36f6700 (LWP 24059)]
[New Thread 0x7fffb35f5700 (LWP 24060)]
[New Thread 0x7fffb34f4700 (LWP 24061)]
[New Thread 0x7fffb33f3700 (LWP 24062)]
[New Thread 0x7fffb32f2700 (LWP 24063)]
[New Thread 0x7fffb31f1700 (LWP 24064)]
[New Thread 0x7fffb30f0700 (LWP 24065)]
[New Thread 0x7fffb2fef700 (LWP 24066)]
[New Thread 0x7fffb2eee700 (LWP 24067)]
[New Thread 0x7fffb2ded700 (LWP 24068)]
[New Thread 0x7fffb2cec700 (LWP 24069)]
[New Thread 0x7fffb2beb700 (LWP 24070)]
[New Thread 0x7fffb2aea700 (LWP 24071)]
[New Thread 0x7fffb29e9700 (LWP 24072)]
[New Thread 0x7fffb28e8700 (LWP 24073)]
[New Thread 0x7fffb27e7700 (LWP 24074)]
[New Thread 0x7fffb26e6700 (LWP 24075)]
[New Thread 0x7fffb25e5700 (LWP 24076)]
[New Thread 0x7fffb24e4700 (LWP 24077)]
[New Thread 0x7fffb23e3700 (LWP 24078)]
[New Thread 0x7fffb22e2700 (LWP 24079)]
[New Thread 0x7fffb21e1700 (LWP 24080)]
[New Thread 0x7fff2f4f4700 (LWP 24081)]
[New Thread 0x7fff2f3f3700 (LWP 24082)]
[New Thread 0x7fff2f2f2700 (LWP 24083)]
[New Thread 0x7fff2f1f1700 (LWP 24084)]
[New Thread 0x7fff2f0f0700 (LWP 24085)]
[New Thread 0x7fff2efef700 (LWP 24086)]
[New Thread 0x7fff2eeee700 (LWP 24087)]
[New Thread 0x7fff2eded700 (LWP 24088)]
[New Thread 0x7fff2ecec700 (LWP 24089)]
[New Thread 0x7fff2ebeb700 (LWP 24090)]
[New Thread 0x7fff2eaea700 (LWP 24091)]
[New Thread 0x7fff2e9e9700 (LWP 24092)]
[New Thread 0x7fff2e8e8700 (LWP 24093)]
[New Thread 0x7fff2e7e7700 (LWP 24094)]
[New Thread 0x7fff2e6e6700 (LWP 24095)]
[New Thread 0x7fff2e5e5700 (LWP 24096)]
[New Thread 0x7fff2e4e4700 (LWP 24097)]
[New Thread 0x7fff2e3e3700 (LWP 24098)]
[New Thread 0x7fff2e2e2700 (LWP 24099)]
[New Thread 0x7fff2e1e1700 (LWP 24100)]
[New Thread 0x7fff2e0e0700 (LWP 24101)]
[New Thread 0x7fff2dfdf700 (LWP 24102)]
[New Thread 0x7fff2dede700 (LWP 24103)]
[New Thread 0x7fff2dddd700 (LWP 24104)]
[New Thread 0x7fff2dcdc700 (LWP 24105)]
[New Thread 0x7fff2dbdb700 (LWP 24106)]
[New Thread 0x7fff2dada700 (LWP 24107)]
[New Thread 0x7fff2d9d9700 (LWP 24108)]
[New Thread 0x7fff2d8d8700 (LWP 24109)]
[New Thread 0x7fff2d7d7700 (LWP 24110)]
[New Thread 0x7fff2d6d6700 (LWP 24111)]
[New Thread 0x7fff2d5d5700 (LWP 24113)]
[New Thread 0x7fff2d4d4700 (LWP 24114)]
[New Thread 0x7fff2d3d3700 (LWP 24115)]
[New Thread 0x7fff2d2d2700 (LWP 24116)]
[New Thread 0x7fff2d1d1700 (LWP 24117)]
[New Thread 0x7fff2d0d0700 (LWP 24118)]
[New Thread 0x7fff2cfcf700 (LWP 24119)]
[New Thread 0x7fff2cece700 (LWP 24120)]
[New Thread 0x7fff2cdcd700 (LWP 24121)]
[New Thread 0x7fff2cccc700 (LWP 24122)]
[New Thread 0x7fff2cbcb700 (LWP 24123)]
[New Thread 0x7fff2caca700 (LWP 24124)]
[New Thread 0x7fff2c9c9700 (LWP 24125)]
[New Thread 0x7fff2c409700 (LWP 24126)]
[New Thread 0x7fff2c308700 (LWP 24127)]
[New Thread 0x7fff2c207700 (LWP 24128)]
[New Thread 0x7fff2c106700 (LWP 24129)]
[New Thread 0x7ffe7c40f700 (LWP 24130)]
[New Thread 0x7ffe7c30e700 (LWP 24131)]
[New Thread 0x7ffe7c20d700 (LWP 24132)]
[New Thread 0x7ffe7c10c700 (LWP 24133)]
[New Thread 0x7ffe305b1700 (LWP 24134)]
[New Thread 0x7ffe304b0700 (LWP 24135)]
[New Thread 0x7ffe303af700 (LWP 24136)]
[New Thread 0x7ffe302ae700 (LWP 24137)]

Thread 2 "java" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fc8700 (LWP 24030)]
0x00007fffe0f83c9c in ?? ()
(gdb) info thread
  Id   Target Id         Frame 
  1    Thread 0x7ffff7fc9700 (LWP 24012) "java" 0x00007ffff71c99cd in pthread_join (threadid=140737353910016, thread_return=0x7fffffffb5e8) at pthread_join.c:90
* 2    Thread 0x7ffff7fc8700 (LWP 24030) "java" 0x00007fffe0f83c9c in ?? ()
  3    Thread 0x7fffe0c0d700 (LWP 24038) "GC Thread#0" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  4    Thread 0x7fffe0b0c700 (LWP 24039) "GC Thread#1" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  5    Thread 0x7fffe0a0b700 (LWP 24040) "GC Thread#2" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  6    Thread 0x7fffe090a700 (LWP 24041) "GC Thread#3" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  7    Thread 0x7fffe0809700 (LWP 24042) "GC Thread#4" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  8    Thread 0x7fffe0708700 (LWP 24043) "GC Thread#5" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  9    Thread 0x7fffe0607700 (LWP 24044) "GC Thread#6" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  10   Thread 0x7fffe0506700 (LWP 24045) "GC Thread#7" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  11   Thread 0x7fffe0405700 (LWP 24046) "GC Thread#8" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  12   Thread 0x7fffe0304700 (LWP 24047) "GC Thread#9" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  13   Thread 0x7fffe0203700 (LWP 24048) "GC Thread#10" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  14   Thread 0x7fffe0102700 (LWP 24049) "GC Thread#11" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  15   Thread 0x7fffb3fff700 (LWP 24050) "GC Thread#12" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  16   Thread 0x7fffb3efe700 (LWP 24051) "GC Thread#13" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  17   Thread 0x7fffb3dfd700 (LWP 24052) "GC Thread#14" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  18   Thread 0x7fffb3cfc700 (LWP 24053) "GC Thread#15" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  19   Thread 0x7fffb3bfb700 (LWP 24054) "GC Thread#16" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  20   Thread 0x7fffb3afa700 (LWP 24055) "GC Thread#17" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  21   Thread 0x7fffb39f9700 (LWP 24056) "GC Thread#18" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  22   Thread 0x7fffb38f8700 (LWP 24057) "GC Thread#19" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  23   Thread 0x7fffb37f7700 (LWP 24058) "GC Thread#20" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  24   Thread 0x7fffb36f6700 (LWP 24059) "GC Thread#21" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  25   Thread 0x7fffb35f5700 (LWP 24060) "GC Thread#22" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  26   Thread 0x7fffb34f4700 (LWP 24061) "GC Thread#23" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  27   Thread 0x7fffb33f3700 (LWP 24062) "GC Thread#24" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  28   Thread 0x7fffb32f2700 (LWP 24063) "GC Thread#25" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  29   Thread 0x7fffb31f1700 (LWP 24064) "GC Thread#26" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  30   Thread 0x7fffb30f0700 (LWP 24065) "GC Thread#27" 0x00007ffff71d0a07 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x7ffff0048480)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:205






Eclipse调试




Eclipse debug

推荐答案

HotSpot JVM在内部使用SEGV信号对于一些不同的事情( NullPointerException ,安全点,......)所以这很可能不是一个错误。在调试HotSpot时,告诉gdb让应用程序处理SEGV信号是很有用的:

The HotSpot JVM uses the SEGV signal internally for a few different things (NullPointerException, safepoints, ...) so this is most likely not an error. When debugging HotSpot, it is useful to tell gdb to let the application handle the SEGV signal:

handle SIGSEGV pass noprint nostop

当你因为gdb收到信号而暂停时,你可以用

When you are already paused because gdb received the signal, you can resume execution with

continue

你也可以在eclipse的调试器控制台中使用这些命令。

You can also use those commands in the debugger console of eclipse.

创建包含的 .gdbinit 文件可能很有用那个命令。在Eclipse中,您可以将运行配置指向该文件(运行配置中调试器下的GDB命令文件)。
这样你就不需要在每个HotSpot调试会话中输入该命令。

It might be useful to create a .gdbinit file that contains that command. In Eclipse you can then point your run configuration to that file ("GDB command file" under "Debugger" in the run configuration). That way you don't need to type that command on every HotSpot debugging session.

这篇关于使用gdb调试JDK9 Hotspot,导致eclipse / Ubuntu终端出现SIGSEGV Segmentation故障的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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