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

Xin Liu xliu at openjdk.java.net
Wed Jul 28 17:44:57 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

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.

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4913/files
  - new: https://git.openjdk.java.net/jdk/pull/4913/files/d94c9d35..dca5f37b

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4913&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4913&range=00-01

  Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 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