You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When applying swift-format to my project it crashes with following stack trace:
💣 Program crashed: System trap at 0x0000aaaac5d215e0
Thread 0 "swift-format" crashed:
0 WhitespaceLinter.contiguousWhitespace(startingAt:in:) in swift-format at /home/build-user/swift-format/Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift:327:11
1 WhitespaceLinter.lint() + 660 in swift-format at /home/build-user/swift-format/Sources/SwiftFormat/PrettyPrint/WhitespaceLinter.swift:56:33
2 SwiftLinter.lint(syntax:operatorTable:assumingFileURL:source:) + 715 in swift-format at /home/build-user/swift-format/Sources/SwiftFormat/API/SwiftLinter.swift:155:8
3 SwiftLinter.lint(source:assumingFileURL:parsingDiagnosticHandler:) + 307 in swift-format at /home/build-user/swift-format/Sources/SwiftFormat/API/SwiftLinter.swift:101:9
4 LintFrontend.processFile(_:) + 555 in swift-format at /home/build-user/swift-format/Sources/swift-format/Frontend/LintFrontend.swift:33:18
5 specialized Sequence.forEach(_:) + 2491 in swift-format at /home/build-user/swift-format/Sources/swift-format/Frontend/Frontend.swift:153:18
6 implicit closure #7 in Frontend.processURLs(_:parallel:) in swift-format at /home/build-user/swift-format/Sources/swift-format/Frontend/Frontend.swift:153:10
7 Frontend.processURLs(_:parallel:) + 699 in swift-format at /home/build-user/swift-format/Sources/swift-format/Frontend/Frontend.swift:153:18
8 Frontend.run() + 199 in swift-format at /home/build-user/swift-format/Sources/swift-format/Frontend/Frontend.swift:102:7
9 closure #1 in SwiftFormatCommand.Lint.run() + 123 in swift-format at /home/build-user/swift-format/Sources/swift-format/Subcommands/Lint.swift:37:18
10 specialized PerformanceMeasurementsOptions.printingInstructionCountIfRequested<A>(_:) in swift-format at Sources/swift-format/Subcommands/PerformanceMeasurement.swift:24:18
11 SwiftFormatCommand.Lint.run() + 175 in swift-format at /home/build-user/swift-format/Sources/swift-format/Subcommands/Lint.swift:35:41
12 0x0000ffff938f84c4 <unknown> in libc.so.6
13 0x0000ffff938f8598 <unknown> in libc.so.6
Here's how you can reproduce the crash:
# Clone the repository
git clone https://github.com/seemoo-lab/CellGuard.git
# Run swift-format included with the latest swift Docker container
docker run --rm -it -v $(pwd)/CellGuard:/app:ro swift:latest
# Inside the container go to the mounted directorycd /app/CellGuardAppSwift
# Run swift-format
swift format lint -r .# At some point, you'll encounter this crash
Best
Lukas
The text was updated successfully, but these errors were encountered:
Hello @lukbukkit!
Thank you for reporting this issue along with the reproduction steps.
I took a quick look into the cause, and it seems that the crash occurs due to a special unicode line separator character(U+2028) present in UserStudyView.swift.
You can check for this character by copying it from here and using Command + F to search for it.
As a temporary workaround, you can simply remove this character to resolve the issue immediately.
Thanks for your quick reply and the workaround! It fixes the crash. I assume those Unicode characters originate from a PDF from which we copied the text.
When applying swift-format to my project it crashes with following stack trace:
Here's how you can reproduce the crash:
Best
Lukas
The text was updated successfully, but these errors were encountered: