JDK-8225113 : Shenandoah: Implement oop_store_not_in_heap barrier
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 13
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2019-05-31
  • Updated: 2019-06-07
  • Resolved: 2019-06-07
Related Reports
Duplicate :  
Description
Since Shenandoah switched to LRB and strong to-space invariant, it is expected to store only to-space oops. 

Ideally, it is enforced by LRB to ensure that only to-space oops in system. Unfortunately, there are some naked loads, e.g. Universe::null_ptr_exception_instance(), etc. that bypasses barrier. These loads can result from-space oops and subsequently be stored in roots.
oop_store_not_in_heap should be able to intercept those stores and resolve them to to-space oops.


Comments
This certainly goes too far. They are small roots that do not worth the effects. I may implement oop_store_not_in_heap barrier in debug only code for catching bad stores.
07-06-2019

Why is Universe::null_ptr_exception_instance() (for example) a problem? Shouldn't that be marked/forwarded when starting a collection, as part of processing the root set? Or if not that, then it (and related stuff) should have an appropriate barrier. They don't currently have barriers because they are roots processed during collection start by all collectors (except Shenandoah? In which case maybe that's a bug in Shenandoah?)
31-05-2019