RFR (XS) 8223570: Shenandoah needs to acquire lock before CLDG::clear_claimed_marks

Roman Kennke roman at kennke.org
Wed May 8 12:11:35 UTC 2019


Looks good. Thanks!

(how has that not failed before? Also, we shall revisit this 
clear_claimed_marks in traversal. It should not be necessary and only 
extend the traversal.)

Roman

> Bug:
>    https://bugs.openjdk.java.net/browse/JDK-8223570
> 
> New assert fails and exposes this legit GC bug. Shenandoah does CLDG::clear_claimed_marks in two
> places, one under the safepoint (which is fine for that assert), and another one in concurrent
> thread, which fails.
> 
> Fix:
> 
> diff -r 845f5a35241b src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp
> --- a/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp Wed May 08 06:40:45 2019 -0400
> +++ b/src/hotspot/share/gc/shenandoah/shenandoahTraversalGC.cpp Wed May 08 13:36:56 2019 +0200
> @@ -552,11 +552,14 @@
>   }
> 
>   void ShenandoahTraversalGC::concurrent_traversal_collection() {
> -  ClassLoaderDataGraph::clear_claimed_marks();
> +  {
> +    MutexLocker ml(ClassLoaderDataGraph_lock);
> +    ClassLoaderDataGraph::clear_claimed_marks();
> +  }
> 
>     ShenandoahGCPhase phase_work(ShenandoahPhaseTimings::conc_traversal);
>     if (!_heap->cancelled_gc()) {
> 
> Testing: hotspot_gc_shenandoah (running)
> 


More information about the shenandoah-dev mailing list