RFR (XS): JDK-8025728: Missing volatile specifier for field G1AllocRegion::_alloc_region

Siebenborn, Axel axel.siebenborn at sap.com
Tue Oct 8 07:33:40 UTC 2013


Hi,
just to bring the thread back to top and give you some more context.
_alloc_region is set in G1AllocRegion::retire(bool fill_up) by mutator threads. 
Concurrently, other mutator threads read it in G1CollectedHeap::unsafe_max_tlab_alloc(Thread* ignored).
Thanks,
Axel


-----Original Message-----
From: axel.siebenborn at sap.com 
Sent: Mittwoch, 2. Oktober 2013 12:39
To: 'Thomas Schatzl'
Cc: hotspot-gc-dev at openjdk.java.net
Subject: RE: RFR (XS): JDK-8025728: Missing volatile specifier for field G1AllocRegion::_alloc_region

Hi Thomas,
the problematic code  was the compiled code of G1CollectedHeap::unsafe_max_tlab_alloc(Thread* ignored).
The program entered the else path, reloaded hr and crashed trying to  invoke a method.
However, I don't know where _alloc_region was set to null concurrently.


-----Original Message-----
From: Thomas Schatzl [mailto:thomas.schatzl at oracle.com] 
Sent: Mittwoch, 2. Oktober 2013 12:12
To: Siebenborn, Axel
Cc: hotspot-gc-dev at openjdk.java.net
Subject: Re: RFR (XS): JDK-8025728: Missing volatile specifier for field G1AllocRegion::_alloc_region

Hi again,

On Wed, 2013-10-02 at 10:42 +0200, Thomas Schatzl wrote:
> Hi Axel,
> 
> On Wed, 2013-10-02 at 07:16 +0000, Siebenborn, Axel wrote:
> > Hi
> > 
> > We investigated some crashes on AIX using the G1 collector. We
> > compiled the HotSpot with IBM XLC12. The reason for the crashes is,
> > that XLC creates code which loads _alloc_region's value and compares
> > it against NULL. Later on, it reloads _alloc_region from memory and
> > uses that new value without another null-check. The problem is that
> > meanwhile another thread has set the _alloc_region's value to NULL.
> 
> Could you give some context to the problem, what particular code is
> involved in this problem?

Just to give background to my question: all code that sets _alloc_region
to NULL, seems to be running serialized in the VM thread. There are also
not that many places where _alloc_region is first stored in a local
variable, then checked against NULL (i.e. assert'ed) and then used
again.

(From a brief code inspection, may be wrong)

Thanks,
Thomas



More information about the hotspot-gc-dev mailing list