Skip to content

Merge r317115 into the 5.0 branch: Fix race condition in omp_init_lock #34519

@hahnjo

Description

@hahnjo
Bugzilla Link 35171
Resolution FIXED
Resolved on Nov 14, 2017 11:21
Version unspecified
OS All
Blocks #33840
CC @AndreyChurbanov,@jpeyton52,@tstellar
Fixed by commit(s) r317115 r318178

Extended Description

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.

Metadata

Metadata

Labels

bugzillaIssues migrated from bugzillaopenmp

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions