兴冲冲的编译完成之后,运行直接出错:
# # A fatal error has been detected by the Java Runtime Environment: # # SIGILL (0x4) at pc=0x000000010f682a49, pid=19068, tid=0x0000000000002803 # # JRE version: OpenJDK Runtime Environment (8.0) (build 1.8.0-internal-taishansoft_2022_02_09_10_00-b00) # Java VM: OpenJDK 64-Bit Server VM (25.71-b00 mixed mode bsd-amd64 compressed oops) # Problematic frame: # V [libjvm.dylib+0x482a49] 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/taishansoft/openjdk8-u252/bin/hs_err_pid19068.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]
按照提示,修改代码:
hotspot/src/share/vm/runtime/perfData.cpp
void PerfDataManager::destroy() { if (_all == NULL) // destroy already called, or initialization never happened return; for (int index = 0; index < _all->length(); index++) { PerfData* p = _all->at(index); //!!! 就是这一句。 //delete p; } delete(_all); delete(_sampled); delete(_constants); _all = NULL; _sampled = NULL; _constants = NULL; }