JDK-8281214 : Unsafe use of long in VMThread::setup_periodic_safepoint_if_needed
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-02-03
  • Updated: 2022-12-12
  • Resolved: 2022-12-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20 b27Fixed
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.
Comments
Changeset: b9eec968 Author: Afshin Zafari <afshin.zafari@oracle.com> Committer: Robbin Ehn <rehn@openjdk.org> Date: 2022-12-05 13:30:15 +0000 URL: https://git.openjdk.org/jdk/commit/b9eec96889abf7df6d2b479e294c7823fb3d5850
05-12-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/11476 Date: 2022-12-02 09:08:22 +0000
02-12-2022

ILW = MLM = P4
08-02-2022

I have no objection to convert it to a sub-task.
03-02-2022

Should this become a sub-task of JDK-8135181?
03-02-2022

This looks like a duplicate of https://bugs.openjdk.java.net/browse/JDK-8135181
03-02-2022

We can fix this but it isn't unsafe in practice as it would require there to be 24.855 days between safepoints.
03-02-2022