SwiftLint: Bus error
New Issue Checklist
- Updated SwiftLint to the latest version
- I searched for existing GitHub issues
Describe the bug
swiftlint lint exits with a bus error when run on my machine, similar to #2391. It happens to me reliably.
See some investigation in the comments below.
Complete output when running SwiftLint, including the stack trace and command used
$ git clone https://github.com/signalapp/Signal-iOS.git
# ...
$ cd Signal-iOS
$ swiftlint lint
# ...lints some files...
# zsh: bus error swiftlint lint
This also happens with swiftlint lint --quiet and swiftlint lint --no-cache.
The example output is lengthy, but nondeterministic (as far as I can tell).
There isn’t an obvious stack trace. (EDIT: See below for a stack trace.)
Environment
- SwiftLint version: 0.47.1
- Installation method used: Homebrew
- Paste your configuration file: public here
- Are you using nested configurations? No
- Which Xcode version are you using (check
xcodebuild -version)? Xcode 13.4, Build version 13F17a
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 18
Here’s some additional info just to help with the possible investigation of the issue.
I was able to reproduce a similar crash with the same “bus error” message by running SwiftLint v 0.47.0 on an M1 Mac using SwiftPM (
swift run swiftlint).Here’s a minimal file that triggered the crash:
However,
swift run swiftlintbuilds the binary in debug configuration.When I run SwiftLint in release configuration using
swift run -c release swiftlint, it no longer crashes.Hope that helps.
As I previously said:
To avoid these stack overflows, please run SwiftLint compiled with
-c releasewhen using SwiftPM or with--config=releasewhen using Bazel, or just use the prebuilt release binaries.