Skip to content

_swift_willThrow is not atomic. #62348

@grynspan

Description

@grynspan

Description

The runtime exports a symbol, _swift_willThrow, for use by testing frameworks (specifically XCTest) to track when errors are thrown for diagnostic purposes. This symbol is not declared as an atomic value, which means that access to it has undefined behavior across threads. Because test logic can run concurrently (and that includes throwing errors), atomic access to this variable is necessary.

Steps to reproduce

N/A

Expected behavior

N/A

Metadata

Metadata

Assignees

Labels

access exclusivityFeature: Enforcement of exclusive access to memorybugA deviation from expected or documented behavior. Also: expected but undesirable behavior.concurrencyFeature: umbrella label for concurrency language featuresruntimeThe Swift Runtime

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions