Assertion failure on PPC64 after 8200545: Improve filter for enqueued deferred cards

Doerr, Martin martin.doerr at sap.com
Fri May 24 13:48:31 UTC 2019


Hi Thomas,

> The only way I could imagine such an error would be if the compiler did
> something weird with writing the fields of the heap attribute table?
> I.e. it loads a machine word (containing four of those RegionAttr
> entries), modifies just one of the bytes, and writes back the whole
> word. I.e. then some concurrent reader might see inconsistent values
> that flip back and forth.
> I really doubt this is the case though. Particularly I assume that at
> least on ppc64/linux you also use gcc.

Correct. It has been built by gcc 7.3.1.
AIX version has been built by clang IBM XL C/C++ for AIX, Version 16.1.0.2.

I wonder why only SPARC needs a workaround.
If Solaris Studio compilers perform such kind of optimizations, other compilers may do that too.
If not now, the next compiler release may do it. Right?
"#ifdef SPARC" doesn't look appropriate to me.
Maybe the fields need to be volatile to prevent such optimizations?
As long as they are not volatile, we allow compilers to reload, reorder, combine loads or stores, etc.


> Can you dump the remembered set states/heap region attributes after
> setting them in the
> G1CollectedHeap::register_regions_with_region_attr() method and
> comparing them with the information from the assert?

I only have the hs_err files at the moment. But I could add tracing and wait for the next occurrence.


> You might want to check that the default value written to
> _needs_remembered_set in G1HeapRegionAttr in its constructor really
> ends up as 0/false. As mentioned there is a bool->uint8_t implicit type
> coercion. (Now I'm in paranoia mode :))

I don't think C++ allows any other encoding as 0/1. And if it did, I think the code would still work because we're only comparing to 0.
And we see the same issue with 2 different compilers (gcc and clang).


Thanks and best regards,
Martin



More information about the hotspot-gc-dev mailing list