Skip to content

[Backtracing][Linux] Replace regex with ProcMapsScanner. #66485

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
Jun 9, 2023

Conversation

al45tair
Copy link
Contributor

@al45tair al45tair commented Jun 9, 2023

We were using a regular expression to scan /proc/<pid>/maps, but we shouldn't really do that because it breaks non-bootstrapped builds. Resolves #66457.

rdar://110452324

We were using a regular expression to scan `/proc/<pid>/maps`, but we
shouldn't really do that because it breaks non-bootstrapped builds.

rdar://110452324
@al45tair al45tair added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.9 labels Jun 9, 2023
@al45tair al45tair requested a review from a team as a code owner June 9, 2023 07:28
@al45tair
Copy link
Contributor Author

al45tair commented Jun 9, 2023

Explanation: Using a regex in the Backtracing module causes build problems. This replaces it with a state-machine based scanner instead.
Risk: Low. The code change only affects Linux, although this also fixes a build problem on macOS because we can't parse the regex syntax unless we've bootstrapped (and we always parse inside #if, this being Swift rather than C).
Original PR: #66449
Reviewed by: @mikeash @gottesmm
Resolves: rdar://110452324
Tests: The Backtracing tests exercise this code; they would all fail on Linux if it didn't work, as we'd be unable to find images in which to look up symbols.

@al45tair
Copy link
Contributor Author

al45tair commented Jun 9, 2023

@swift-ci Please test

@al45tair
Copy link
Contributor Author

al45tair commented Jun 9, 2023

@swift-ci Please test Windows platform

@al45tair al45tair merged commit 7dce152 into swiftlang:release/5.9 Jun 9, 2023
@AnthonyLatsis AnthonyLatsis linked an issue Jun 28, 2023 that may be closed by this pull request
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 5.9
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Building stdlib/public/Backtracing/Backtrace.swift fails
2 participants