➜ ~ gdb --version GNU gdb (GDB) 9.1 Copyright (C) 2020 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.
➜ Desktop /Users/chenyuan/Workspaces/Openjdk/openjdk8/build/macosx-x86_64-normal-server-release/jdk/bin/javac Test.java # # A fatal error has been detected by the Java Runtime Environment: # # SIGILL (0x4) at pc=0x000000010267c7eb, pid=89116, tid=0x0000000000004f03 # # JRE version: OpenJDK Runtime Environment (8.0) (build 1.8.0-internal-chenyuan_2020_05_24_03_17-b00) # Java VM: OpenJDK 64-Bit Server VM (25.71-b00 mixed mode bsd-amd64 compressed oops) # Problematic frame: # V [libjvm.dylib+0x47c7eb] PerfDataManager::destroy()+0xab # # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /Users/chenyuan/Desktop/hs_err_pid89116.log # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # [error occurred during error reporting , id 0x4]
[1] 89116 abort Test.java ➜ Desktop ll total 112 -rw-r--r-- 1 chenyuan staff 415B May 24 21:33 Test.class -rw-r--r-- 1 chenyuan staff 116B May 24 21:31 Test.java -rw-r--r-- 1 chenyuan staff 46K May 24 21:33 hs_err_pid89116.log ➜ Desktop /Users/chenyuan/Workspaces/Openjdk/openjdk8/build/macosx-x86_64-normal-server-release/jdk/bin/java Test hello world ! ------- 牛逼的打印,无敌的HelloWorkd # # A fatal error has been detected by the Java Runtime Environment: # # SIGILL (0x4) at pc=0x000000010be7c7eb, pid=89512, tid=0x0000000000002403 # # JRE version: OpenJDK Runtime Environment (8.0) (build 1.8.0-internal-chenyuan_2020_05_24_03_17-b00) # Java VM: OpenJDK 64-Bit Server VM (25.71-b00 mixed mode bsd-amd64 compressed oops) # Problematic frame: # V [libjvm.dylib+0x47c7eb] PerfDataManager::destroy()+0xab # # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /Users/chenyuan/Desktop/hs_err_pid89512.log # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash.jsp # [error occurred during error reporting , id 0x4]
➜ Desktop gdb --args /Users/chenyuan/Workspaces/Openjdk/openjdk8/build/macosx-x86_64-normal-server-release/jdk/bin/java Test GNU gdb (GDB) 9.1 Copyright (C) 2020 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-apple-darwin19.3.0". 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 /Users/chenyuan/Workspaces/Openjdk/openjdk8/build/macosx-x86_64-normal-server-release/jdk/bin/java... (gdb) break init.cpp:95 No source file named init.cpp. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (init.cpp:95) pending. (gdb) run Starting program: /Users/chenyuan/Workspaces/Openjdk/openjdk8/build/macosx-x86_64-normal-server-release/jdk/bin/java Test [New Thread 0x1803 of process 22052] [New Thread 0x2503 of process 22052] [New Thread 0x2403 of process 22052] warning: unhandled dyld version (16) [New Thread 0x180f of process 22052] [New Thread 0x2303 of process 22052]
Thread 4 received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x180f of process 22052] 0x00000001040002b4 in ?? () (gdb) l 111 // add one more to mark the end 112 margv = (char **)JLI_MemAlloc((margc + 1) * (sizeof(char *))); 113 { 114 int i = 0; 115 StdArg *stdargs = JLI_GetStdArgs(); 116 for (i = 0 ; i < margc ; i++) { 117 margv[i] = stdargs[i].arg; 118 } 119 margv[i] = NULL; 120 } (gdb) quit A debugging session is active.