編譯jdk8主卫,9都是成功的胰耗,但是運行的時候遇到了這個問題。
Error: A fatal exception has occurred. Program will exit.
localhost:bin jjchen$ ./java -version
openjdk version "1.8.0-internal"
OpenJDK Runtime Environment (build 1.8.0-internal-jjchen_2018_09_13_10_00-b00)
OpenJDK 64-Bit Server VM (build 25.71-b00, mixed mode)
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGILL (0x4) at pc=0x0000000107487f47, pid=88445, tid=0x0000000000002603
#
# JRE version: OpenJDK Runtime Environment (8.0) (build 1.8.0-internal-jjchen_2018_09_13_10_00-b00)
# Java VM: OpenJDK 64-Bit Server VM (25.71-b00 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V [libjvm.dylib+0x487f47]
#
# 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/jjchen/jvm/jdk8u-dev/build/macosx-x86_64-normal-server-release/jdk/bin/hs_err_pid88445.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
把系統(tǒng)的libjvm.dylib 拷貝到jdk/lib/server中程序可以運行穗泵,說明是編譯的jvm庫出了問題泽篮。
后來調試的時候發(fā)現(xiàn)崩在了這個文件中的函數盗尸。/Users/jjchen/jvm/jdk8u-dev/hotspot/src/share/vm/runtime/perfData.cpp。把"delete p;"這行注釋掉可以正常停止了咪辱。
這個問題花了好幾天振劳,記錄一下。
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;
}