RFR (S): 8024974 - Incorrect use of GC_locker::is_active()

Per Liden per.liden at oracle.com
Wed Sep 18 23:03:29 PDT 2013

Webrev: http://cr.openjdk.java.net/~pliden/8024974/webrev.01/

Bug: https://bugs.openjdk.java.net/browse/JDK-8024974

SymbolTable and StringTable can make calls to GC_locker::is_active() 
outside a safepoint. This isn't safe because the GC_locker active state 
(lock count) is only updated at a safepoint and only remains valid as 
long as _needs_gc is true. However, outside a safepoint _needs_gc can 
change to false at any time, which makes it impossible to do a correct 
call to is_active() in that context. In this case these calls can just 
be removed since the input argument to basic_add() should never be on 
the heap and so there's no need to check the GC_locker state. This 
change also adjusts the assert() in is_active() to makes sure all calls 
to this function are always done under a safepoint.


More information about the hotspot-gc-dev mailing list