RFR: 8271353: PerfDataManager::destroy crashes in VM_Exit [v2]

Yumin Qi minqi at openjdk.java.net
Wed Jul 28 20:01:33 UTC 2021


On Wed, 28 Jul 2021 17:44:57 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
>
> Xin Liu has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Print 0 instead of -1 when _sampled or _constants is not avaiable.
>   
>   also update copyright year.

Marked as reviewed by minqi (Reviewer).

-------------

PR: https://git.openjdk.java.net/jdk/pull/4913


More information about the hotspot-runtime-dev mailing list