Integrated: 8271353: PerfDataManager::destroy crashes in VM_Exit
Xin Liu
xliu at openjdk.java.net
Wed Jul 28 23:10:31 UTC 2021
On Tue, 27 Jul 2021 23:37:58 GMT, Xin Liu <xliu at openjdk.org> wrote:
> 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
This pull request has now been integrated.
Changeset: 41b4c190
Author: Xin Liu <xliu at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/41b4c19086c0b238bdeea9f3f14ee9997253b2f2
Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod
8271353: PerfDataManager::destroy crashes in VM_Exit
Reviewed-by: dholmes, stuefe, minqi
-------------
PR: https://git.openjdk.java.net/jdk/pull/4913
More information about the hotspot-runtime-dev
mailing list