swiftlang / sourcekit-lsp

Language Server Protocol implementation for Swift and C-based languages
Apache License 2.0
3.21k stars 264 forks source link

Heap allocate our atomics #1429

Closed ahoppen closed 1 month ago

ahoppen commented 1 month ago

We used C atomics but these were allocated as Swift variables. Even thought they were atomic, concurrent accesses to them could violate Swift’s exclusivity laws, raising thread sanitizer errors.

Allocate the C atomics using malloc to fix this problem.

rdar://129170128

ahoppen commented 1 month ago

@swift-ci Please test

ahoppen commented 1 month ago

@swift-ci Please test

ahoppen commented 1 month ago

@swift-ci Please test Windows

ahoppen commented 1 month ago

@swift-ci Please test

ahoppen commented 1 month ago

@swift-ci Please test Windows