JDK-8257509 : Strengthen requirements to call G1HeapVerifier::verify(VerifyOption)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-12-01
  • Updated: 2020-12-17
  • Resolved: 2020-12-04
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 16
16 b28Fixed
Related Reports
Relates :  
Description
G1HeapVerifier::verify() seems to miss a return:

void G1HeapVerifier::verify(VerifyOption vo) {
  if (!SafepointSynchronize::is_at_safepoint()) {
    log_info(gc, verify)("Skipping verification. Not at safepoint.");
    // here?
  }
  assert(Thread::current()->is_VM_thread(),
         "Expected to be executed serially by the VM thread at this point");

Found by [~stefank] during discussion of JDK-8256641.

This seems to be the case since initial import of that file.
Comments
Changeset: ca402671 Author: Thomas Schatzl <tschatzl@openjdk.org> Date: 2020-12-04 08:40:12 +0000 URL: https://git.openjdk.java.net/jdk/commit/ca402671
04-12-2020

Yes, it can be turned into an assert afaics from testing so far.
02-12-2020

I wonder if this should be turned into an assert instead of adding a return. It would at least be a good experiment to see if we could enter this path outside of a safepoint.
01-12-2020