RFR(sh/jdk8): Fix racy update of code roots

Zhengyu Gu zgu at redhat.com
Tue Dec 8 20:45:32 UTC 2020


Looks good. It is consistent with what we do in later version.

Thanks,

-Zhengyu

On 12/8/20 3:34 PM, Roman Kennke wrote:
> This is jdk8-specific (I have checked jdk16 and jdk11 and they don't 
> have this problem).
> 
> There is a race in ShenadoahRootUpdater: threads go into 
> threads::oops_do() with a CodeBlobClosure and then they *also* go into 
> ShenandoahCodeRoots::oops_do(). This leads to visiting nmethods 
> concurrently, which is problematic because fix_relocations() is not 
> MT-safe and will mess up oops in nmethods.
> 
> Conservative fix:
> http://cr.openjdk.java.net/~rkennke/fixracycodecacheupdate/webrev.00/
> 
> (jdk11 and even more so jdk16 go further than this and remove the 
> update_code_cache path altogether, but I don't want to attempt this in 
> jdk8 just now)
> 
> This bug was exposed by the recent Cassandra-related bug report test-case:
> https://mail.openjdk.java.net/pipermail/shenandoah-dev/2020-December/014044.html 
> 
> 
> 
> and I verified that the bug is fixed by that.
> 
> Also: hotspot_gc_shenandoah
> 
> Ok?
> 



More information about the shenandoah-dev mailing list