Skip to content

swiftlint analyze llvm segmentation fault #6546

@rgoldberg

Description

@rgoldberg

New Issue Checklist

Bug Description

I get an llvm segmentation fault for the swiftlint analyze command below for the current HEAD of the main branch of mas (535562b304eb110700eb57f289317f7b5c41cb2d).

This is not a new problem, but I just got around to reporting it. The problem first occurred when I changed a Collection utility function to use a TaskGroup to operate on elements in parallel in commit 8c097a1a8248515ce81c88990a70f6495f180a15.

If you need any more information to replicate the exact scenario, please let me know.

Thanks for any help & for SwiftLint.

$ swiftlint analyze --strict --quiet --reporter relative-path --compiler-log-path =(xcodebuild -scheme mas -destination "platform=macOS,arch=arm64,variant=macos" 2>&1)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
(decl_context: )(decl_context: )Stack dump:
0.	While performing cached IDE inspection if possible
1.	While performing cached IDE inspection in decl context:
    ---
    0xc3eea17c0 Module name=mas
      0xc50746008 FileUnit file="/mas/Sources/mas/Utilities/Collection.swift"
        0xc38958d18 ExtensionDecl line=14 base=Collection
          0xc38f4d490 AbstractFunctionDecl name=concurrentTransform(maxConcurrentTaskCount:_:) : (no type set)
    ---
2.	While evaluating request IDEInspectionSecondPassRequest(source_file "/mas/Sources/mas/Utilities/Collection.swift", )
3.	While IDE inspecting starting at /mas/Sources/mas/Utilities/Collection.swift:67:13
4.	While evaluating request TypeCheckASTNodeAtLocRequest(0xc446130a0 AbstractClosureExpr line=66 : () async throws -> (Int, T?), )
5.	While evaluating request TypeCheckASTNodeAtLocRequest(0xc44612d60 AbstractFunctionDecl name=addNextTask() : <Self, T where Self : Collection, T : Sendable, Self.Element : Sendable> () -> (), )
6.	While type-checking expression at [/mas/Sources/mas/Utilities/Collection.swift:66:6 - line:68:6] RangeText="group.addTask {
						(next.offset, try await transform(next.element))
					"
7.	While type-checking-target starting at /mas/Sources/mas/Utilities/Collection.swift:66:12
[1]    68272 segmentation fault  swiftlint analyze --strict --quiet --reporter relative-path  

Environment

  • SwiftLint: 0.63.2
  • Xcode: Xcode 26.3 / Build version 17C529
  • Installation method: Homebrew Core
  • Swift: swift-driver version: 1.127.15 Apple Swift version 6.2.4 (swiftlang-6.2.4.1.4 clang-1700.6.4.2) / Target: arm64-apple-macosx26.0
  • macOS: 26.3.1 (a) (25D771280a)
  • Configuration file:
#
# .swiftlint.yml
# mas
#
# SwiftLint 0.63.2
#
---
excluded:
- .build/
- .idea/
- .swiftpm/
- .vscode/
opt_in_rules:
- all
analyzer_rules:
- all
disabled_rules:
- closure_body_length
- contrasted_opening_brace
- cyclomatic_complexity
- explicit_acl
- explicit_enum_raw_value
- explicit_self
- explicit_top_level_acl
- explicit_type_interface
- file_header
- function_body_length
- large_tuple
- multiple_closures_with_trailing_closure
- no_extension_access_modifier
- no_grouping_extension
- no_magic_numbers
- prefixed_toplevel_constant
- strict_fileprivate
- type_body_length
attributes:
  always_on_line_above: ['@Flag', '@MainActor', '@OptionGroup', '@TaskLocal']
deployment_target:
  macOS_deployment_target: 13
  macOSApplicationExtension_deployment_target: 13
  iOS_deployment_target: 99
  iOSApplicationExtension_deployment_target: 99
  tvOS_deployment_target: 99
  tvOSApplicationExtension_deployment_target: 99
  watchOS_deployment_target: 99
  watchOSApplicationExtension_deployment_target: 99
file_length:
  ignore_comment_only_lines: true
  warning: 500
file_name:
  excluded: [Group.swift, InstalledApp+Spotlight.swift, Process.swift, User.swift]
file_types_order:
  order:
  - main_type
  - supporting_type
  - extension
  - preview_provider
  - library_content_provider
function_parameter_count:
  warning: 6
indentation_width:
  indentation_width: 2
  include_multiline_strings: false
line_length:
  ignores_multiline_strings: true
  ignores_regex_literals: true
modifier_order:
  preferred_modifier_order:
  - acl
  - setterACL
  - override
  - isolation
  - dynamic
  - mutators
  - lazy
  - final
  - required
  - convenience
  - typeMethods
  - owned
multiline_arguments:
  first_argument_location: next_line
non_optional_string_data_conversion:
  include_variables: true
number_separator:
  minimum_length: 6
opening_brace:
  ignore_multiline_statement_conditions: true
operator_usage_whitespace:
  skip_aligned_constants: false
prefer_key_path:
  restrict_to_standard_functions: false
private_over_fileprivate:
  validate_extensions: true
redundant_self:
  only_in_closures: false
redundant_type_annotation:
  consider_default_literal_types_redundant: true
trailing_comma:
  mandatory_comma: true
trailing_whitespace:
  ignores_comments: false
type_contents_order:
  order:
  - case
  - associated_type
  - type_alias
  - subtype
  - type_property
  - instance_property
  - ib_inspectable
  - ib_outlet
  - initializer
  - deinitializer
  - type_method
  - view_life_cycle_method
  - ib_action
  - subscript
  - other_method
unneeded_override:
  affect_initializers: true
unused_import:
  require_explicit_imports: true
  allowed_transitive_imports:
  - module: Darwin
    allowed_transitive_imports:
    - _DarwinFoundation1
    - _DarwinFoundation2
    - _DarwinFoundation3
  - module: Swift
    allowed_transitive_imports:
    - _Concurrency
    - _StringProcessing
vertical_whitespace_between_cases:
  separation: never

Are you using nested configurations?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions