RFR: 8234509: Race in macOS os::processor_id()

erik.osterlund at oracle.com erik.osterlund at oracle.com
Thu Nov 21 09:46:11 UTC 2019


Hi Per,

Thanks for the review!

/Erik

On 11/21/19 10:39 AM, Per Liden wrote:
> Looks good!
>
> /Per
>
> On 11/21/19 10:15 AM, 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