RFR: 8234509: Race in macOS os::processor_id()
David Holmes
david.holmes at oracle.com
Thu Nov 21 09:23:22 UTC 2019
Hi Erik,
Looks good. Good catch!
Thanks,
David
On 21/11/2019 7:15 pm, erik.osterlund at oracle.com wrote:
> Hi,
>
> In os::processor_id() on macOS, a CAS protects initialization of
> processor ID number given an APIC id. However, the CAS is not converted
> properly to a boolean determining whether it succeeded or failed. The
> implicit boolean conversion is wrong, allowing multiple threads to
> increment the next processor ID. The result is that if another thread
> runs on a different APIC id, we can get IDs that are higher than the
> number of processors.
>
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8234509
>
> Webrev:
> http://cr.openjdk.java.net/~eosterlund/8234509/webrev.00/
>
> Thanks,
> /Erik
More information about the hotspot-runtime-dev
mailing list