Skip to content

Implement LockedState for Musl #1101

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

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

jmschonfeld
Copy link
Contributor

Unfortunately, we're missing a few conditionals in the LockedState implementation that left LockedState acting as a no-op for the static linux SDK. This results in the lack of synchronization of caches in swift-foundation for that platform. I went ahead and added the right conditionals for Musl (same as Glibc) and also added an explicit #else case with a #error so that we can more quickly and easily detect platforms for which we have not implemented synchronization primitives here.

I've confirmed that running the sample program in the linked issue produces the segmentation fault but with this change the fault no longer occurs.

Resolves #1100

@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld jmschonfeld merged commit 280ebf6 into swiftlang:main Dec 20, 2024
3 checks passed
@jmschonfeld jmschonfeld deleted the lockedstate-musl branch December 20, 2024 21:42
jmschonfeld added a commit to jmschonfeld/swift-foundation that referenced this pull request Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Static Linux SDK: SIGSEGV: invalid address when concurrently creating Calendar instances.
4 participants