Skip to content

Conversation

al45tair
Copy link
Contributor

Requests to sleep until a negative timestamp would result in sleeping until UINT64_MAX nanoseconds from the start of the relevant clock, which is about 585 years.

rdar://154346018

Requests to sleep until a negative timestamp would result in sleeping
until `UINT64_MAX` nanoseconds from the start of the relevant clock,
which is about 585 years.

rdar://154346018
@al45tair al45tair requested a review from a team as a code owner June 27, 2025 10:16
@al45tair al45tair added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels Jun 27, 2025
@al45tair
Copy link
Contributor Author

Explanation: It's possible to pass a negative time to the Dispatch executor, and if you do that then you may end up trying to sleep for up to 585 years, which is effectively forever.
Risk: Low. It's a very small change.
Original PR: #82563
Reviewed by: @ktoso
Resolves: rdar://154346018
Tests: There is a test that tries to do negative sleeps. I'm not sure why it didn't catch this previously but it definitely was picking it up in my most recent Concurrency branch (#82456), and I think it's a good bet that this is the thing causing occasional inexplicable hangs during PR testing.

@al45tair
Copy link
Contributor Author

@swift-ci Please test

@al45tair
Copy link
Contributor Author

@swift-ci Please test macOS platform

1 similar comment
@al45tair
Copy link
Contributor Author

al45tair commented Jul 1, 2025

@swift-ci Please test macOS platform

@al45tair al45tair merged commit c56ec77 into swiftlang:release/6.2 Jul 2, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍒 release cherry pick Flag: Release branch cherry picks swift 6.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants