JDK-8273486 : Zero: Handle DiagnoseSyncOnValueBasedClasses VM option
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 17,18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-09-08
  • Updated: 2022-06-13
  • Resolved: 2021-09-14
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 17 JDK 18
17.0.2Fixed 18 b15Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
JDK-8257027 added a diagnostic option to check for synchronization on value-based classes. Zero does not support it, so it would fail the relevant test:

$ CONF=linux-x86_64-zero-fastdebug make exploded-test TEST=runtime/Monitor/SyncOnValueBasedClassTest.java

STDERR:
 stdout: [];
 stderr: [Exception in thread "main" java.lang.RuntimeException: synchronization on value based class did not fail
	at SyncOnValueBasedClassTest$FatalTest.main(SyncOnValueBasedClassTest.java:128)
]
 exitValue = 1

java.lang.RuntimeException: 'fatal error: Synchronizing on object' missing from stdout/stderr 

Template interpreters implement this check by going to to slowpath that calls InterpreterRuntime::monitorenter. Zero already goes to that path when UseHeavyMonitors is enabled, so we might just enable it when lock diagnostics is requested. This would cost us zero (pun intended) when diagnostic option is disabled.
Comments
Fix Request (17u) Fixes another Zero test for 17u. Does not apply cleanly, requires a minor adjustment in the test. Patch acked by phh.
16-11-2021

17u backporting note: the test uses UseOptoBiasInlining that is C2-specific flag and not available for Zero.
06-10-2021

Changeset: 86a8e552 Author: Aleksey Shipilev <shade@openjdk.org> Date: 2021-09-14 08:14:35 +0000 URL: https://git.openjdk.java.net/jdk/commit/86a8e5524ddb5e25dab54b4f56cc1b9c27d0a4a6
14-09-2021