Skip to content

MinGW: mitigate potential abort on rwlocks using PTHREAD_RWLOCK_INITIALIZER - #1530

Merged
justsmth merged 3 commits into
aws:mainfrom
justinwsmith:static-mutex-init
Apr 16, 2024
Merged

justsmth merged 3 commits into
aws:mainfrom
justinwsmith:static-mutex-init

Conversation

@justinwsmith

Copy link
Copy Markdown
Contributor

Description of changes:

  • On some platforms/pthreads-implementations, there are race conditions on the first use of rwlocks initialized with PTHREAD_RWLOCK_INITIALIZER.
  • This change allows for a re-attempt on lock acquisition when it initially fails on MinGW, The current logic aborts the process when this occurs.
  • A test is added to attempt to reproduce the race-condition, although success of it can be a false-negative for such a bug.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@justinwsmith
justinwsmith requested a review from a team as a code owner April 15, 2024 16:25
@justinwsmith justinwsmith changed the title MinGW: potential abort on rwlocks using PTHREAD_RWLOCK_INITIALIZER MinGW: mitigate potential abort on rwlocks using PTHREAD_RWLOCK_INITIALIZER Apr 15, 2024
@torben-hansen
torben-hansen self-requested a review April 15, 2024 16:35
Comment thread crypto/thread_pthread.c Resolved
@justsmth
justsmth force-pushed the static-mutex-init branch 2 times, most recently from 64c9407 to cc6b513 Compare April 15, 2024 17:58
skmcgrail
skmcgrail previously approved these changes Apr 15, 2024
@justsmth
justsmth force-pushed the static-mutex-init branch 3 times, most recently from 9556a21 to 028ce2a Compare April 15, 2024 19:56
@justsmth
justsmth force-pushed the static-mutex-init branch from 028ce2a to 02bcd7d Compare April 15, 2024 20:21
skmcgrail
skmcgrail previously approved these changes Apr 16, 2024
torben-hansen
torben-hansen previously approved these changes Apr 16, 2024
Comment thread crypto/thread_pthread.c Resolved
@justsmth
justsmth merged commit b8aff82 into aws:main Apr 16, 2024
@vszakats vszakats mentioned this pull request Nov 4, 2024
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants