RFR: 8234509: Race in macOS os::processor_id()
erik.osterlund at oracle.com
erik.osterlund at oracle.com
Thu Nov 21 09:31:44 UTC 2019
Hi Robbin,
Thanks for the review!
/Erik
On 11/21/19 10:23 AM, Robbin Ehn wrote:
> Looks good, thanks, Robbin
>
> On 2019-11-21 10:15, 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