Skip to content

Conversation

@ahoppen
Copy link
Member

@ahoppen ahoppen commented Oct 23, 2025

  • Explanation: os_log only allows creating a limited number of Logger objects, after the maximum number is reached, creating a new Logger will crash the process. To avoid this happening, we only used the last two digest of request IDs for the logger name for request handling. This computation inside the SourceKit plugin was incorrect due to misinterpreted operator precedence. Add parentheses to fix this
  • Scope: SourceKit plugin
  • Issue: rdar://162891887
  • Original PR: Add missing parentheses around logging scope computation #2329 (review)
  • Risk: Very low, only changes the name of logging scopes
  • Testing: none
  • Reviewer: @bnbarham

The modulo operator associated `0` and `100`, so the computation here was essentially `handle?.numericValue ?? (0 % 100)`, equivalent to `handle?.numericValue ?? 0`, which means that we didn’t acutally perform modulo operations on the numeric value, which means that we would exceed the maximum number of `os_log_t` objects after some time.

rdar://162891887
@ahoppen ahoppen requested a review from a team as a code owner October 23, 2025 07:17
@ahoppen
Copy link
Member Author

ahoppen commented Oct 23, 2025

@swift-ci Please test

@bnbarham bnbarham merged commit b67724f into swiftlang:release/6.2 Oct 23, 2025
3 checks passed
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.

2 participants