llvm-project/openmp/runtime/test/lock
Jonathan Peyton 3d18a37ca9 [OpenMP] Fix race condition in omp_init_lock
This is a partial fix for bug 34050.

This prevents callers of omp_set_lock (which does not hold __kmp_global_lock)
from ever seeing an uninitialized version of __kmp_i_lock_table.table.

It does not solve a use-after-free race condition if omp_set_lock obtains a
pointer to __kmp_i_lock_table.table before it is updated and then attempts to
dereference afterwards. That race is far less likely and can be handled in a
separate patch.

The unit test usually segfaults on the current trunk revision. It passes with
the patch.

Patch by Adam Azarchs

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

llvm-svn: 317115
2017-11-01 19:44:42 +00:00
..
omp_init_lock.c [OpenMP] Fix race condition in omp_init_lock 2017-11-01 19:44:42 +00:00
omp_lock.c Remove redundant %libomp-compile step from test/lock/omp_lock.c 2016-06-23 16:18:59 +00:00
omp_nest_lock.c
omp_test_lock.c Fix bugs in TAS and futex lock 2016-06-28 19:37:24 +00:00
omp_test_nest_lock.c