JDK-7123165 : G1: output during parallel verification can get messed up
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs23
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-12-20
  • Updated: 2013-09-18
  • Resolved: 2012-03-29
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 7 JDK 8 Other
7u4Fixed 8Fixed hs23Fixed
Parallel heap verification in G1 currently has a flaw which is that, if different GC workers find and attempt to report issues around the same time the output can get messed up. This is not a correctness flaw, i.e. the issues will be correctly identified and reported. However, it does sometimes make it very hard to make sense of the output. It'd be helpful to ensure that the output generated by parallel heap verification is always easily readable.

EVALUATION http://hg.openjdk.java.net/lambda/lambda/hotspot/rev/3b2b58fb1425

EVALUATION http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/rev/3b2b58fb1425

SUGGESTED FIX While each GC worker generates output during parallel heap verification we should take a lock to ensure only one worker generates output at any one time. We can use ParGCRareEvent_lock, I don't think there's much point in introducing a new one just for this. Also note that taking the lock will not affect the performance of heap verification in the normal case (where there are no failures). It will only serialize the workers when a failure is detected which is not a big issue given that we are about to fail anyway.

EVALUATION See Description.