[all-commits] [llvm/llvm-project] 35fdf8: [OpenMP] Fix a segment fault in __kmp_get_global_t...

Shilei Tian via All-commits all-commits at lists.llvm.org
Thu Aug 31 18:15:43 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 35fdf8d70329b2b067cb9433a5891f2a57e2f4ed
  Author: Shilei Tian <i at tianshilei.me>
  Date:   2023-08-31 (Thu, 31 Aug 2023)

  Changed paths:
    M openmp/runtime/src/kmp_runtime.cpp

  Log Message:
  [OpenMP] Fix a segment fault in __kmp_get_global_thread_id

In `__kmp_get_global_thread_id`, if the gtid mode is 1, after getting the gtid
from TLS, it will store the gtid value to the thread stack maintained in the thread
descriptor. However, `__kmp_get_global_thread_id` can be called when the library
is destructed, after the corresponding thread info has been release. This will
cause a segment fault. This can happen on an Intel-based Mac.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D159324

More information about the All-commits mailing list