This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][libomp] Hold old __kmp_threads arrays until library shutdown
ClosedPublic

Authored by jlpeyton on May 5 2022, 7:23 AM.

Details

Summary

When many nested teams are formed, __kmp_threads may be reallocated
to accommodate new threads. This reallocation causes a data
race when another existing team's thread simultaneously references
__kmp_threads. This patch keeps the old thread arrays around until library
shutdown so these lingering references can complete without issue and
access to __kmp_threads remains a simple array reference.

Fixes: https://github.com/llvm/llvm-project/issues/54708

Diff Detail

Event Timeline

jlpeyton created this revision.May 5 2022, 7:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2022, 7:23 AM
jlpeyton requested review of this revision.May 5 2022, 7:23 AM
This revision is now accepted and ready to land.Jun 21 2022, 3:49 PM