RFR: 8281214: Unsafe use of long in VMThread::setup_periodic_safepoint_if_needed

Afshin Zafari duke at openjdk.org
Fri Dec 2 09:17:12 UTC 2022


### Description 
In VMThread::setup_periodic_safepoint_if_needed there is an unsafe use of long:

long interval_ms = SafepointTracing::time_since_last_safepoint_ms();

because SafepointTracing::time_since_last_safepoint_ms returns jlong which can be bigger than long.

### Patch
Changed `long` to `jlong`.

### Test
local:  make test TEST=runtime/Thread
mach5: tier1

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

Commit messages:
 - 8281214: Unsafe use of long in VMThread::setup_periodic_safepoint_if_needed

Changes: https://git.openjdk.org/jdk/pull/11476/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11476&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8281214
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/11476.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11476/head:pull/11476

PR: https://git.openjdk.org/jdk/pull/11476


More information about the hotspot-runtime-dev mailing list