Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MinGW: mitigate potential abort on rwlocks using PTHREAD_RWLOCK_INITIALIZER #1530

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

justinwsmith
Copy link
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
@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
skmcgrail
skmcgrail previously approved these changes Apr 16, 2024
torben-hansen
torben-hansen previously approved these changes Apr 16, 2024
crypto/thread_pthread.c Outdated Show resolved Hide resolved
@justsmth justsmth merged commit b8aff82 into aws:main Apr 16, 2024
46 checks passed
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