使用gdb进行JDK9 Hotspot调试,导致eclipse / Ubuntu终端中出现SIGSEGV分段错误

2024-03-05

我正在尝试调试 JDK9。

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

我使用 gdb 和 Eclipse 但有一个问题SIGSEGV Segmentation fault.

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

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

Then,

make all

我得到了我的定制调试版本:

/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 来调试代码。我start全局数据库。乍一看似乎不错。然而,当这个程序开始运行时thread 2,它提出了问题SIGSEGV Segmentation fault。我不知道为什么以及如何解决它。同样的,我用Eclipse来调试,其实和gdb没什么区别。从根本上来说,他们都使用gdb。然后我遇到了同样的问题。

终端调试

错误部分:

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 信息:

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 调试


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

handle SIGSEGV pass noprint nostop

当您因为 gdb 收到信号而已经暂停时,您可以使用以下命令恢复执行

continue

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

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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用gdb进行JDK9 Hotspot调试,导致eclipse / Ubuntu终端中出现SIGSEGV分段错误 的相关文章

  • 无法在 Visual Studio 和 vcpkg 中构建 cmake 项目(致命错误 C1083)

    我今天安装了vcpkg 启用了与Visual Studio的集成 即 vcpkg集成安装 并开始安装库 我基本上安装了 cpprestsdk 并触发了 boost 库的安装 然后我在 Visual Studio CMake 中打开该项目 当
  • 如何检查给定调用站点的重载决策集

    如何检查重载解析集 我在多个调用站点中使用了 4 个相互竞争的函数 在一个调用站点中 我期望调用一个函数 但编译器会选择另一个函数 我不知道为什么 这不是微不足道的 为了了解发生了什么 我正在使用enable if disable if打开
  • 嵌入式 tomcat 7 servlet 3.0 注释不起作用

    我有一个精简的测试项目 其中包含 Servlet 版本 3 0 用注释声明 如下所示 WebServlet test public class TestServlet extends HttpServlet private static f
  • 字节码和位码有什么区别[重复]

    这个问题在这里已经有答案了 可能的重复 LLVM 和 java 字节码有什么区别 https stackoverflow com questions 454720 what are the differences between llvm
  • @TestPropertySource 不适用于 Spring 1.2.6 中使用 AnnotationConfigContextLoader 的 JUnit 测试

    似乎我在 Spring 4 1 17 中使用 Spring Boot 1 2 6 RELEASE 所做的任何事情都不起作用 我只想访问应用程序属性并在必要时通过测试覆盖它们 无需使用 hack 手动注入 PropertySource 这不行
  • 我如何模拟 UserManager 和 RoleManager 进行单元测试

    我模拟了抽象类来测试类的具体方法 如下所示 var mock new Mock
  • 代码块 - 使用大地址感知标志进行编译

    如何使用以下命令在 64 位系统上编译 32 位应用程序LARGE ADRESS AWARE使用代码块标记 我需要使用超过 2GB 的内存 应该是添加的情况 Wl large address aware到链接标志 我不使用 CodeBloc
  • 指向 VLA 的指针

    你可能知道 VLA 的优点和缺点 https stackoverflow com a 3082302 1606345在 C11 中它们是可选的 我认为使 VLA 成为可选的主要原因是 堆栈可能会爆炸 int arr n where n 10
  • C++ 更改屏幕方向问题 -- DEVMODE dmDisplayOrientation DMDO_90 undefined

    我似乎无法编译一些 C 代码 我正在翻转显示器的方向 但 VS2008 告诉我 DMDO 90 和 DMDO 270 无法识别 error C2065 DMDO 90 undeclared identifier error C2065 DM
  • 使用 C# 的异步 WebRequest

    您好 我有一个函数 它将 url Get 参数传递到网络服务器上的 php 文件 并等待文件的响应 通常需要 10 20 秒 我想将其放入一个循环中 因为我必须一次将这些 Get 请求发送到大约 5 个不同的 php 文件 但是当我尝试将其
  • C# 从今天起 30 天

    我需要我的应用程序从今天起 30 天后过期 我会将当前日期存储在应用程序配置中 如何检查应用程序是否已过期 我不介意用户是否将时钟调回来并且应用程序可以正常工作 用户太愚蠢而不会这样做 if appmode Trial string dat
  • 为什么将未使用的返回值转换为 void?

    int fn void whatever void fn 是否有任何理由将未使用的返回值强制转换为 void 或者我认为这完全是浪费时间 David s answer https stackoverflow com questions 68
  • C# XML 反序列化。将节点中的所有内部文本读取到字符串属性中

    我目前正在尝试修改我的类 以便我的模型上的文本属性包含某个节点的所有内部文本 text node 给我带来问题的 xml 示例是
  • 为什么在 C++ 类中的数据成员上使用像 m_ 这样的前缀?

    许多 C 代码使用语法约定来标记数据成员 常见的例子包括 m memberName对于公共成员 在所有使用公共成员的情况下 memberName对于私人会员或所有会员 其他人尝试强制使用this gt member每当使用数据成员时 根据我
  • 提升shared_from_this<>()

    有人可以用几句话概括一下如何提升shared from this lt gt 应该使用智能指针 特别是从使用绑定函数在 io service 中注册处理程序的角度来看 编辑 一些回复要求提供更多背景信息 基本上 我正在寻找 陷阱 即人们使用
  • 查找文本文件中每行的行大小

    如何计算每行中的字符或数字数量 是否有类似 EOF 的东西更像是行尾 您可以遍历行中的每个字符并不断增加计数器直到行尾 n 遇到 确保以文本模式打开文件 r 而不是二进制模式 rb 否则流不会自动将不同平台的行结束序列转换为 n 人物 这是
  • 如何在c#中获取斐波那契数

    伙计们 我有一个关于斐波那契的问题 如何获得斐波那契数列 该数字也将以用户输入结束 例如 如果我输入 21 则输出必须为 0 1 1 2 3 5 8 13 21 这是我的代码 static void Main string args int
  • 如何在Java中跨类共享变量,我尝试了静态不起作用

    类 Testclass1 有一个变量 有一些执行会改变变量的值 现在在同一个包中有类 Testclass2 我将如何访问 Testclass2 中变量的更新值 由 Testclass1 更新 试过这个没用 注意 Testclass1和Tes
  • 将隐藏(生物识别)数据附加到 pdf 上的数字签名

    我想知道是否可以使用 iText 我用于签名 或 Java 中的其他工具在 pdf 上添加生物识别数据 我会更好地解释一下 在手写板上签名时 我会收集签名信息 例如笔压 签名速度等 我想将这些信息 java中的变量 与pdf上的签名一起存储
  • C#“var”关键字在 VB.NET 中的等价物是什么?

    例如 我如何获得 VB NET静态类型局部变量是static赋值右侧的表达式的类型 像这样 Dim http msdn microsoft com en us library 7ee5a7s1 aspx我的变量 3 你还需要 选项推断 ht

随机推荐

  • 与 ANT 模式语法的混淆和可能的变化

    我正在开发 ANT 模式解析器 作为大型服务器项目的一部分 这篇文章的答案中有一些很好的 ANT 模式示例 如何使用 Nant Ant 命名模式 https stackoverflow com questions 69835 how do
  • Android 12 - 致命异常:android.content.res.Resources$NotFoundException

    我在 Android 12 设备上收到以下错误 Fatal Exception android content res Resources NotFoundException Resource ID 0x20c0025 at android
  • 将成员对象的引用添加到指针数组

    我有一个类 其中包含一些包含对象的私有成员和一个动态指针数组 我想用指向其中一些成员对象的指针填充该数组 class NextionTest public NextionDisplay private NexText lblText Nex
  • Sequelize 和 Postgres 按距点的距离排序

    我在搜索时遇到问题 包括按距某个点的距离排序 这是我的代码以及我正在尝试做的事情 感谢帮助 const Sequelize require sequelize var Flat db define flat id type Sequeliz
  • React 中的事件驱动方法?

    我想在一个组件中 触发一个事件 并让其他组件 订阅 该事件并在 React 中执行一些工作 例如 这是一个典型的 React 项目 我有一个模型 从服务器获取数据 并使用该数据呈现多个组件 interface Model id number
  • Android,在网络共享和连接到接入点时检测 WiFi 的本地 IP 和子网掩码

    我需要检测本地IP地址和子网掩码在 WiFi 网络上 在 Android 设备上 为了严格计算本地子网的 UDP 广播地址 当设备连接到接入点时 以下功能正常工作 Only works when NOT tethering WifiMana
  • Nuxt不会自动从嵌套目录导入组件

    在我的 nuxt 应用程序中 嵌套目录中的组件不会按预期自动导入 对于我的一些组件 我有如下内容 vue 2 6 12 nuxt 2 15 0 components 目录结构 TopArea SomeComponent vue
  • WPF 用户控件而非数据绑定

    在我的用户控件中 我有一个不是数据绑定的依赖属性 我查看了几篇堆栈溢出帖子 但我无法弄清楚我做错了什么 永远不会调用属性更改方法 到目前为止我的代码 我的用户控件基本上是一个增强的组合框 DP 位于用户控件内部 我正在数据网格内使用此用户控
  • 如何使用python将一幅图像的相位和不同图像的幅度组合成一幅图像

    我想将一幅图像的相位谱和不同图像的幅度谱组合成一幅图像 我得到了图像A和图像B的相位谱和幅度谱 这是代码 f np fft fft2 grayA fshift1 np fft fftshift f phase spectrumA np an
  • 数据库设计 - 一个表中的列引用两个表

    这是我所拥有的一个示例 以 Stack Overflow 为例 我有2张桌子 Questions and Answers 我也有一个Comments桌子 评论表将引用问题和答案 我应该如何设置数据库 评论中有 2 列 即 QuestionI
  • HTTP 响应中标头的顺序重要吗?

    标题的顺序是否有意义 A 1 B 2 vs B 2 A 1 我试图弄清楚是否可以使用字典来存储标题列表 或者它是否需要是某种列表或有序字典 不 具有不同名称的标头并不重要 看RFC 2616 https www rfc editor org
  • 使用 Q Promise 进行串行执行

    我想我误解了如何Q https github com kriskowal q承诺工作 我希望我的第一个承诺在下一个承诺开始之前得到解决 但这并没有发生 这是我的代码 var Q require q function doWork taskN
  • Apache Common CLI:如何添加参数?

    我正在将 Common CLI 用于个人项目 我从文档中没有找到的一件事是如何强制呈现某个参数 为了澄清我的问题 我可以定义参数和选项之间的区别 命令 mycommand file txt b 2 mycommand is the comm
  • Windows Phone 7 图像按钮

    我需要为我的应用程序创建一个图像按钮 例如面向网络的风格 我有一个 20x20 像素的图像 并且想要一个与图像尺寸相同的图像按钮 我尝试在我的 xaml 中设置它 但它不起作用
  • 使用 LLVM 将 x86 代码重新编译为更快的 x86

    是否可以输入 x86 32 位代码来运行 LLVM 编译器 有一个巨大的算法 我没有源代码 我想让它在相同的硬件上运行得更快 我可以通过优化将其从 x86 转换回 x86 吗 这段代码运行时间很长 所以我想对其进行静态重新编译 另外 我可以
  • Android——如何允许水平和垂直滚动

    ScrollView 只允许垂直滚动 Horizo ntalScrollView 只允许水平滚动 但两者都没有类 这似乎是 Android 用户界面中一个相当大的缺陷 有什么技巧可以实现这一点吗 Try this
  • 当我们有阻塞调用时,我们应该使用像 spring webflux 这样的反应式堆栈 Web 框架吗?

    我试图了解什么时候我们会使用像 webflux 这样的反应式堆栈框架 我读过的文章似乎表明 当我们有许多阻塞调用时 我们将从反应式方法中受益 例如 如果我们有一个 Webhook 服务 需要调用客户端服务器来更新信息 但我也在这里读过htt
  • 如何使用 jQuery 的锚点设置文本框的值?

    我有一个文本框 我想根据锚标记的内部文本设置其值 换句话说 当有人点击这个锚点时 a href class clickable Blah a 我希望我的文本框填充文本 Blah 这是我当前使用的代码 在我的 html 中 有一个带有 cli
  • Mac (UNIX) 系统上的 PATH 是什么?

    我正在尝试从 git 设置一个项目 Storm https github com nathanmarz storm wiki Setting up development environment https github com natha
  • 使用gdb进行JDK9 Hotspot调试,导致eclipse / Ubuntu终端中出现SIGSEGV分段错误

    我正在尝试调试 JDK9 我想跟踪源代码并查看JDK Hotspot代码的控制流程 我使用 gdb 和 Eclipse 但有一个问题SIGSEGV Segmentation fault 我按照JDK官方文档中的Buildme md来配置JD