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

Evgeny Astigeevich eastigeevich at openjdk.org
Fri Dec 2 09:58:07 UTC 2022


On Fri, 2 Dec 2022 09:08:22 GMT, Afshin Zafari <duke at openjdk.org> wrote:

> ### 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

Thank you for fixing this. Lgtm.

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

Marked as reviewed by eastigeevich (Committer).

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


More information about the hotspot-runtime-dev mailing list