RFR: 8271353: PerfDataManager::destroy crashes in VM_Exit
Xin Liu
xliu at openjdk.java.net
Tue Jul 27 23:45:40 UTC 2021
This patch check PerfDataManager::_sampled and _constants is NULL. if it is,
return -1.
When the user enables UL `-Xlog:perf+datacreation=debug`, it may crash in
PerfDataManager::destroy(). The following line will crash when _sampled is NULL.
log_debug(perf, datacreation)("Total = %d, Sampled = %d, Constants = %d",
_all->length(), _sampled->length(), _constants->length());
This only happens when UsePerfData is on and PerfDataManager::destroy() is invoked before
StatSampler::initialize() which initializes PerfDataManager::_sampled.
PerfDataManager::destroy() is called by VM_Exit which can be triggered by SIGINT on Linux anytime.
A reproducible: invoke the following command and keep pressing Ctrl-c.
$perf stat -r 100 java -Xlog:perf+datacreation=debug --version
-------------
Commit messages:
- 8271353: PerfDataManager::destroy crashes in VM_Exit
Changes: https://git.openjdk.java.net/jdk/pull/4913/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4913&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8271353
Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
Patch: https://git.openjdk.java.net/jdk/pull/4913.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/4913/head:pull/4913
PR: https://git.openjdk.java.net/jdk/pull/4913
More information about the hotspot-runtime-dev
mailing list