SwiftLint crashes with `Illegal instruction` and `exit code 132` on Ubuntu 20.04
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 19.7k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
New Issue Checklist
- [x ] Updated SwiftLint to the latest version
- [x ] I searched for existing GitHub issues
Describe the bug
I'm running SwiftLint installed installed with Mint on Ubuntu 20.04 on GitHub Actions.
Today Github updated the image (from 20230917.1.0 to 20230924.1.0) that introduced swift 5.9 (see diff: https://github.com/actions/runner-images/commit/5e9e8cd16d1e79f138e110e2fd6f5b447a92df93#diff-fbbd26652e305be8b13c83d79ad91d7105dc03f8ea64a13eeaf95b857118f5aaR32).
Before the update everything worked fine and this is the only change.
After that update SwiftLint consistently crashes with 4898 Illegal instruction (core dumped) immediately after start.
On my mac running macOS 14.0 Beta (23A5337a) with xcode 15 beta 8 (Version 15.0 beta 8 (15A5229m)) I do not see the issue and it runs fine.
When trying to replicate the environment in a Docker container with similar config (Ubuntu 20.04 with Swift 5.9) I do not see the issue either so this is maybe not a SwiftLint issue but maybe something with GitHub actions but I report it here anyways since someone might know how to fix it.
Complete output when running SwiftLint, including the stack trace and command used
`$ ./mint-cache/mint run swiftlint lint /home/runner/xxx --no-cache --config /home/runner/work/xxx/.swiftlint.yml --reporter json --output /home/runner/work/xxx/swift-lint-result.json 2> /dev/null`
output:
/home/runner/work/_temp/6204b6fb-8c76-4309-8103-19d2695fcb49.sh: line 1: 4898 Illegal instruction (core dumped) ./mint-cache/mint run swiftlint lint /home/runner/work/xxx --no-cache --config /home/runner/work/xxx/.swiftlint.yml --reporter json --output /home/runner/work/xxx/swift-lint-result.json 2> /dev/null
Error: Process completed with exit code 132.
Environment
Version: SwiftLint 0.53.0
Installation: mint (Mint compiles it from source)
OS: Linux Ubuntu 20.04 (github actions image 20230924.1.0)
- Paste your configuration file:
only_rules: # only these rules will be applied
# - colon
# - comma
# - conditional_returns_on_newline
- control_statement
- empty_enum_arguments
- empty_parameters
- empty_parentheses_with_trailing_closure
- legacy_cggeometry_functions
- legacy_constant
- legacy_constructor
- legacy_hashing
- legacy_nsgeometry_functions
- class_delegate_protocol
# - weak_delegate
- anyobject_protocol
- closing_brace
# - closure_parameter_position
# - closure_spacing
- explicit_init
- generic_type_name
- identical_operands
# - implicit_getter
- is_disjoint
- leading_whitespace
- literal_expression_end_indentation
- mark
# - operator_usage_whitespace
- operator_whitespace
- overridden_super_call
- override_in_extension
- prohibited_super_call
- protocol_property_accessors_order
- redundant_discardable_let
- redundant_nil_coalescing
- redundant_objc_attribute
# - redundant_optional_initialization
- redundant_void_return
- return_arrow_whitespace
- shorthand_operator
# - statement_position
# - switch_case_alignment
- syntactic_sugar
# - trailing_comma
- trailing_semicolon
- unneeded_break_in_switch
- unused_enumerated
- unused_optional_binding
- valid_ibinspectable
# - vertical_whitespace
- void_return
- yoda_condition
- array_init
- compiler_protocol_init
# - contains_over_first_not_nil
- discouraged_direct_init
- discouraged_object_literal
- dynamic_inline
- force_try
- implicitly_unwrapped_optional
- force_unwrapping
# - legacy_random
# - custom_rules
excluded:
- XXX/XXX
- YYY/YYY/YYY
- ZZZ
- AAA/AAA.swift
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji, sonarqube, markdown)
force_try: warning
-
Are you using nested configurations?
If so, paste their relative paths and respective contents.
NO -
Which Xcode version are you using (check
xcodebuild -version)?
no xcode on the machine since it is Linux -
Do you have a sample that shows the issue?
./mint-cache/mint run swiftlint lint /home/runner/xxx --no-cache --config /home/runner/work/xxx/.swiftlint.yml --reporter json --output /home/runner/work/xxx/swift-lint-result.json 2> /dev/null
Outputs:
/home/runner/work/_temp/6204b6fb-8c76-4309-8103-19d2695fcb49.sh: line 1: 4898 Illegal instruction (core dumped)
The temp file name might be to GitHub Actions that is running the action in a temp file.
The number before "Illegal Instruction" is changing every run.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied Mint SwiftLint command on the GitHub Actions Ubuntu 20.04 image with Swift 5.9, then compare it with the reported Docker environment and macOS environment. The issue is complete when the source of the illegal instruction is identified and the confirmed cause is fixed or clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, swift, ubuntu
- Domain
- ci-cd, devtools, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100