RFR: 8225716: G1 GC: Undefined behaviour in G1BlockOffsetTablePart::block_at_or_preceding

Andrew Haley aph at redhat.com
Mon Jun 17 12:53:29 UTC 2019


On 6/17/19 1:46 PM, Aleksey Shipilev wrote:
> On 6/17/19 2:37 PM, Andrew Haley wrote:
>> http://cr.openjdk.java.net/~aph/8225716-jdk8u/
>>
>> This patch had to be backported with changes because current Atomic
>> support doesn't work for byte accesses, so volatile will suffice.
> 

> Well, there are OrderAccess j(u)byte methods you can use here, along
> with some STATIC_ASSERTs that verify uchar and jubyte actually
> agree? Or even explicit fences before/after the access to get
> acquire/release?

We want no fences. These are relaxed loads and stores.

> It would be awkward to have the same bug ID having different memory
> semantics fixes.

I can't see any way to do it otherwise: we have no relaxed atomics on
8u that I can find. maybe they're hiding, but I don't think so.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the jdk8u-dev mailing list