Closed
Description
New Issue Checklist
- Updated SwiftLint to the latest version
- I searched for existing GitHub issues
Describe the bug
Crashed when type name is _
Complete output when running SwiftLint, including the stack trace and command used
swift run --package-path SwiftLint -c release swiftlint crashing_swiftlint.swift
Thread 1 Crashed:: Dispatch queue: com.apple.root.user-initiated-qos
0 swiftlint 0x1003d157c Swift runtime failure: String index is out of bounds + 0 [inlined]
1 swiftlint 0x1003d157c $sSSySJSS5IndexVcig + 0 [inlined]
2 swiftlint 0x1003d157c specialized TypeNameRule.validate(name:dictionary:file:offset:) + 3468 (TypeNameRule.swift:50)
3 swiftlint 0x1003d0b18 specialized TypeNameRule.validate(name:dictionary:file:offset:) + 808 (TypeNameRule.swift:45)
4 swiftlint 0x1003d16c8 $s18SwiftLintFramework12TypeNameRuleV8validate33_7DF859E6F5A02C40F75B5DFD3104E77ALL4name10dictionary4file6offsetSayAA14StyleViolationVGSS_AA22SourceKittenDictionaryVAA0aB4FileC0wxC09ByteCountVtF + 28 [inlined]
5 swiftlint 0x1003d16c8 specialized TypeNameRule.validate(file:kind:dictionary:) + 232 (TypeNameRule.swift:32)
6 swiftlint 0x10031ebb0 $s18SwiftLintFramework12TypeNameRuleV8validate4file4kind10dictionarySayAA14StyleViolationVGAA0aB4FileC_012SourceKittenC00A15DeclarationKindOAA0nO10DictionaryVtF + 12 [inlined]
7 swiftlint 0x10031ebb0 $s18SwiftLintFramework12TypeNameRuleVAA7ASTRuleA2aDP8validate4file4kind10dictionarySayAA14StyleViolationVGAA0aB4FileC_04KindD0QzAA22SourceKittenDictionaryVtFTW + 12 (<compiler-generated>:24) [inlined]
8 swiftlint 0x10031ebb0 $s18SwiftLintFramework7ASTRulePAAE8validate4file10dictionarySayAA14StyleViolationVGAA0aB4FileC_AA22SourceKittenDictionaryVtFAISgAMXEfU_AA12TypeNameRuleV_Tg5 + 36 (ASTRule.swift:43) [inlined]
9 swiftlint 0x10031ebb0 $s18SwiftLintFramework7ASTRulePAAE8validate4file10dictionarySayAA14StyleViolationVGAA0aB4FileC_AA22SourceKittenDictionaryVtFAISgAMXEfU_AA12TypeNameRuleV_TG5 + 60 [inlined]
10 swiftlint 0x10031ebb0 partial apply for specialized closure #1 in ASTRule.validate(file:dictionary:) + 88
11 swiftlint 0x1003179f4 specialized SourceKittenDictionary.traverseDepthFirst<A>(collectingValuesInto:traverseBlock:) + 180
12 swiftlint 0x1003179e0 specialized SourceKittenDictionary.traverseDepthFirst<A>(collectingValuesInto:traverseBlock:) + 160
13 swiftlint 0x10030fd70 protocol witness for Rule.validate(file:using:compilerArguments:) in conformance TypeNameRule + 176
14 swiftlint 0x1002dd540 specialized Rule.lint(file:regions:benchmark:storage:configuration:superfluousDisableCommandRule:compilerArguments:) + 708 (Linter.swift:77)
15 swiftlint 0x1002dd00c $s18SwiftLintFramework4RulePAAE4lint33_5A5F37FCDEE0B4D78BAE05A90BA8A062LL4file7regions9benchmark7storage13configuration025superfluousDisableCommandD017compilerArgumentsAA0B6ResultAELLVSgAA0aB4FileC_SayAA6RegionVGSbAA0D7StorageCAA13ConfigurationVAA011SuperfluousuvD0VSgSaySSGtF + 36 [inlined]
16 swiftlint 0x1002dd00c $s18SwiftLintFramework15CollectedLinterV18getStyleViolations33_5A5F37FCDEE0B4D78BAE05A90BA8A062LL5using9benchmarkSayAA0G9ViolationVG_SaySS2id_Sd4timetGtAA11RuleStorageC_SbtFAA0B6ResultAELLVSgAA0W0_pXEfU0_ + 64 (Linter.swift:222) [inlined]
17 swiftlint 0x1002dd00c partial apply for closure #2 in CollectedLinter.getStyleViolations(using:benchmark:) + 108
18 swiftlint 0x1002bdea0 $sSa18SwiftLintFrameworkE11parallelMap9transformSayqd__Gqd__xXE_tlFADSryqd__SgGzXEfU_ySiXEfU_AA4Rule_p_AA0B6Result33_5A5F37FCDEE0B4D78BAE05A90BA8A062LLVSgTg5 + 28 (Array+SwiftLint.swift:66) [inlined]
19 swiftlint 0x1002bdea0 partial apply for specialized closure #1 in closure #1 in Array.parallelMap<A>(transform:) + 76
20 libswiftDispatch.dylib 0x1b196b074 partial apply for thunk for @callee_guaranteed (@unowned Int) -> () + 28
21 libswiftDispatch.dylib 0x1b196b0a0 thunk for @escaping @callee_guaranteed (@unowned Int) -> () + 32
22 libdispatch.dylib 0x19f03e208 _dispatch_client_callout2 + 20
23 libdispatch.dylib 0x19f052f8c _dispatch_apply_invoke_and_wait + 224
24 libdispatch.dylib 0x19f05226c _dispatch_apply_with_attr_f + 1152
25 libdispatch.dylib 0x19f05247c dispatch_apply + 108
26 libswiftDispatch.dylib 0x1b196b144 _swift_dispatch_apply_current + 128
27 libswiftDispatch.dylib 0x1b196aff8 static OS_dispatch_queue.concurrentPerform(iterations:execute:) + 196
28 swiftlint 0x1002bc8e8 specialized closure #1 in Array.parallelMap<A>(transform:) + 92 (Array+SwiftLint.swift:65)
29 swiftlint 0x1002bc1e4 $sSryqd__SgGSayqd__Gs5Error_pIglozo_AbCsAD_pIeglrzo_r__lTR18SwiftLintFramework4Rule_p_AE0C6Result33_5A5F37FCDEE0B4D78BAE05A90BA8A062LLVSgTg5 + 20 [inlined]
30 swiftlint 0x1002bc1e4 $sSryqd__SgGSayqd__Gs5Error_pIglozo_AbCsAD_pIeglrzo_r__lTR18SwiftLintFramework4Rule_p_AE0C6Result33_5A5F37FCDEE0B4D78BAE05A90BA8A062LLVSgTG5 + 20 [inlined]
31 swiftlint 0x1002bc1e4 $ss15ContiguousArrayV30withUnsafeMutableBufferPointeryqd__qd__SryxGzKXEKlF18SwiftLintFramework0I6Result33_5A5F37FCDEE0B4D78BAE05A90BA8A062LLVSgSg_SayAIGTg5 + 52 [inlined]
32 swiftlint 0x1002bc1e4 $sSa18SwiftLintFrameworkE11parallelMap9transformSayqd__Gqd__xXE_tlFAA4Rule_p_AA0B6Result33_5A5F37FCDEE0B4D78BAE05A90BA8A062LLVSgTg5 + 80 (Array+SwiftLint.swift:64) [inlined]
33 swiftlint 0x1002bc1e4 specialized Array.parallelCompactMap<A>(transform:) + 128 (Array+SwiftLint.swift:59)
34 swiftlint 0x1002d96a4 CollectedLinter.getStyleViolations(using:benchmark:) + 696 (Linter.swift:221)
35 swiftlint 0x1002d93d0 CollectedLinter.styleViolations(using:) + 20 (Linter.swift:190)
36 swiftlint 0x1007c9570 closure #1 in static LintOrAnalyzeCommand.collectViolations(builder:) + 112 (LintOrAnalyzeCommand.swift:63)
37 swiftlint 0x1007cec48 $s18SwiftLintFramework13ConfigurationV9swiftlintE5visit33_30E847BB8C9F32DCEAC767137A79F9B7LL7linters7visitor7storage18duplicateFileNamesSayAA0abS0CGSayAA15CollectedLinterVG_AD20LintableFilesVisitorVAA11RuleStorageCShySSGtFAlOcfU_yyXEfU0_yyXEfU_ + 12 (Configuration+CommandLine.swift:206) [inlined]
38 swiftlint 0x1007cec48 specialized static Signposts.record<A>(name:span:body:) + 564 (Signposts.swift:32)
39 swiftlint 0x1007c24b0 $s18SwiftLintFramework13ConfigurationV9swiftlintE5visit33_30E847BB8C9F32DCEAC767137A79F9B7LL7linters7visitor7storage18duplicateFileNamesSayAA0abS0CGSayAA15CollectedLinterVG_AD20LintableFilesVisitorVAA11RuleStorageCShySSGtFAlOcfU_yyXEfU0_ + 76 (Configuration+CommandLine.swift:205) [inlined]
40 swiftlint 0x1007c24b0 partial apply for closure #2 in closure #1 in Configuration.visit(linters:visitor:storage:duplicateFileNames:) + 96
41 swiftlint 0x1007c24d8 $ss5Error_pIgzo_ytsAA_pIegrzo_TR + 4 [inlined]
42 swiftlint 0x1007c24d8 partial apply for thunk for @callee_guaranteed () -> (@error @owned Error) + 20
43 swiftlint 0x1007c2738 thunk for @callee_guaranteed () -> (@error @owned Error)partial apply + 12
44 libswiftObjectiveC.dylib 0x1b3dddad4 autoreleasepool<A>(invoking:) + 64
45 swiftlint 0x1007be844 closure #1 in Configuration.visit(linters:visitor:storage:duplicateFileNames:) + 716 (Configuration+CommandLine.swift:204)
46 swiftlint 0x1007c260c $s18SwiftLintFramework15CollectedLinterVAA0aB4FileCIggo_AcEIegnr_TR + 56 [inlined]
47 swiftlint 0x1007c260c partial apply for thunk for @callee_guaranteed (@guaranteed CollectedLinter) -> (@owned SwiftLintFile) + 80
48 swiftlint 0x1007bb9fc specialized closure #1 in closure #1 in Array.parallelMap<A>(transform:) + 348 (Array+SwiftLint.swift:14)
49 libswiftDispatch.dylib 0x1b196b074 partial apply for thunk for @callee_guaranteed (@unowned Int) -> () + 28
50 libswiftDispatch.dylib 0x1b196b0a0 thunk for @escaping @callee_guaranteed (@unowned Int) -> () + 32
51 libdispatch.dylib 0x19f03e208 _dispatch_client_callout2 + 20
52 libdispatch.dylib 0x19f052b58 _dispatch_apply_serial + 164
53 libdispatch.dylib 0x19f03e1c8 _dispatch_client_callout + 20
54 libdispatch.dylib 0x19f043584 _dispatch_sync_function_invoke + 52
55 libdispatch.dylib 0x19f052318 _dispatch_apply_with_attr_f + 1324
56 libdispatch.dylib 0x19f05247c dispatch_apply + 108
57 libswiftDispatch.dylib 0x1b196b144 _swift_dispatch_apply_current + 128
58 libswiftDispatch.dylib 0x1b196aff8 static OS_dispatch_queue.concurrentPerform(iterations:execute:) + 196
59 swiftlint 0x1007c1698 $sSa9swiftlintE11parallelMap9transformSayqd__Gqd__xXE_tlFySryqd__Gz_SiztXEfU_18SwiftLintFramework15CollectedLinterV_AF0eF4FileCTg5 + 76 (Array+SwiftLint.swift:11) [inlined]
60 swiftlint 0x1007c1698 specialized Array.init(_unsafeUninitializedCapacity:initializingWith:) + 192
61 swiftlint 0x1007c1adc $sSa28_unsafeUninitializedCapacity16initializingWithSayxGSi_ySryxGz_SiztKXEtKcfC18SwiftLintFramework0fG4FileC_Tg5079$sSa9swiftlintE11parallelMap9transformSayqd__Gqd__xXE_tlFySryqd__Gz_SiztXEfU_18fg34Framework15CollectedLinterV_AF0eF4I4CTg5SayAE0xY0VGxq_r0_lyAjGIsgnr_Tf1ncn_n + 24 [inlined]
62 swiftlint 0x1007c1adc $sSa9swiftlintE11parallelMap9transformSayqd__Gqd__xXE_tlF18SwiftLintFramework15CollectedLinterV_AE0eF4FileCTg5 + 24 [inlined]
63 swiftlint 0x1007c1adc specialized Configuration.visit(linters:visitor:storage:duplicateFileNames:) + 1028 (Configuration+CommandLine.swift:211)
64 swiftlint 0x1007d14cc $s18SwiftLintFramework13ConfigurationV9swiftlintE5visit33_30E847BB8C9F32DCEAC767137A79F9B7LL7linters7visitor7storage18duplicateFileNamesSayAA0abS0CGSayAA15CollectedLinterVG_AD20LintableFilesVisitorVAA11RuleStorageCShySSGtF + 16 [inlined]
65 swiftlint 0x1007d14cc $s18SwiftLintFramework13ConfigurationV9swiftlintE18visitLintableFiles4with7storages6ResultOySayAA0aB4FileCGAD0aB5ErrorOGAD0gH7VisitorV_AA11RuleStorageCtFALSayAA15CollectedLinterVG_ShySSGtXEfU4_ALyXEfU_ + 16 (Configuration+CommandLine.swift:76) [inlined]
66 swiftlint 0x1007d14cc specialized static Signposts.record<A>(name:span:body:) + 780 (Signposts.swift:32)
67 swiftlint 0x1007bc4ac $s9swiftlint9SignpostsV6record4name4span4bodyxs12StaticStringV_AC4SpanOxyXEtlFZSay18SwiftLintFramework0jK4FileCG_Tg504$s18jk88Framework13ConfigurationV9swiftlintE18visitLintableFiles4with7storages6ResultOySayAA0aB4M96CGAD0aB5ErrorOGAD0gH7VisitorV_AA11RuleStorageCtFALSayAA15CollectedLinterVG_ShySSGtXEfU4_ALyXEfU_AL0P0VSayAL15CollectedLinterVGAA0S12FilesVisitorVAL11RuleStorageCShySSGTf1nncn_n + 44 [inlined]
68 swiftlint 0x1007bc4ac $s18SwiftLintFramework13ConfigurationV9swiftlintE18visitLintableFiles4with7storages6ResultOySayAA0aB4FileCGAD0aB5ErrorOGAD0gH7VisitorV_AA11RuleStorageCtFALSayAA15CollectedLinterVG_ShySSGtXEfU4_ + 44 (Configuration+CommandLine.swift:75) [inlined]
69 swiftlint 0x1007bc4ac $sSay18SwiftLintFramework15CollectedLinterVGShySSGSayAA0aB4FileCGIgggo_AD_AEtAHIegnr_TR + 44 [inlined]
70 swiftlint 0x1007bc4ac $ss6ResultO3mapyAByqd__q_Gqd__xXElFSay18SwiftLintFramework15CollectedLinterVG_ShySSGt_9swiftlint0cD5ErrorOSayAE0cD4FileCGTg5 + 44 [inlined]
71 swiftlint 0x1007bc4ac Configuration.visitLintableFiles(with:storage:) + 700 (Configuration+CommandLine.swift:74)
72 swiftlint 0x1007c942c $s18SwiftLintFramework13ConfigurationV9swiftlintE18visitLintableFiles7options5cache7storage12visitorBlocks6ResultOySayAA0aB4FileCGAD0aB5ErrorOGAD0B16OrAnalyzeOptionsV_AA11LinterCacheCSgAA11RuleStorageCyAA09CollectedT0VctFAqD0gH7VisitorVXEfU_ + 16 (Configuration+CommandLine.swift:258) [inlined]
73 swiftlint 0x1007c942c $ss6ResultO7flatMapyAByqd__q_GADxXElF9swiftlint20LintableFilesVisitorV_AE14SwiftLintErrorOSay0hI9Framework0hI4FileCGTg5 + 16 [inlined]
74 swiftlint 0x1007c942c $s18SwiftLintFramework13ConfigurationV9swiftlintE18visitLintableFiles7options5cache7storage12visitorBlocks6ResultOySayAA0aB4FileCGAD0aB5ErrorOGAD0B16OrAnalyzeOptionsV_AA11LinterCacheCSgAA11RuleStorageCyAA09CollectedT0VctF + 244 (Configuration+CommandLine.swift:257) [inlined]
75 swiftlint 0x1007c942c static LintOrAnalyzeCommand.collectViolations(builder:) + 844 (LintOrAnalyzeCommand.swift:48)
76 swiftlint 0x1007d1ba0 $s9swiftlint20LintOrAnalyzeCommandV04lintcD033_50703DD9A63FFC386F0BA0D6C49778EBLLys6ResultOyytAA05SwiftB5ErrorOGAA0bcD7OptionsVFZ + 52 (LintOrAnalyzeCommand.swift:40) [inlined]
77 swiftlint 0x1007d1ba0 $s9swiftlint20LintOrAnalyzeCommandV3runys6ResultOyytAA05SwiftB5ErrorOGAA0bcD7OptionsVFZAIyXEfU_ + 60 (LintOrAnalyzeCommand.swift:34) [inlined]
78 swiftlint 0x1007d1ba0 specialized static Signposts.record<A>(name:span:body:) + 684 (Signposts.swift:32)
79 swiftlint 0x1007b2fa0 $s9swiftlint9SignpostsV6record4name4span4bodyxs12StaticStringV_AC4SpanOxyXEtlFZs6ResultOyytAA14SwiftLintErrorOG_Tg5014$s9swiftlint20l24OrAnalyzeCommandV3runys6j8OyytAA05k2B5M27OGAA0bcD7OptionsVFZAIyXEfU_AA0lopX0VAA0lopQ0VXMtTf1nncn_n + 32 [inlined]
80 swiftlint 0x1007b2fa0 $s9swiftlint20LintOrAnalyzeCommandV3runys6ResultOyytAA05SwiftB5ErrorOGAA0bcD7OptionsVFZ + 104 (LintOrAnalyzeCommand.swift:33) [inlined]
81 swiftlint 0x1007b2fa0 SwiftLint.Lint.run() + 8016 (Lint.swift:55)
82 swiftlint 0x1007b33a0 protocol witness for ParsableCommand.run() in conformance SwiftLint.Lint + 12
83 swiftlint 0x1001d80d8 static ParsableCommand.main(_:) + 92 (ParsableCommand.swift:97)
84 swiftlint 0x1007ba7f8 specialized static SwiftLint.mainHandlingDeprecatedCommands(_:) + 452 (SwiftLint.swift:24)
85 swiftlint 0x1007aa35c $s9swiftlint9SwiftLintV30mainHandlingDeprecatedCommandsyySaySSGSgFZ + 8 [inlined]
86 swiftlint 0x1007aa35c closure #1 in + 16 (main.swift:11)
87 swiftlint 0x1002bf00c thunk for @escaping @callee_guaranteed () -> () + 28
88 libdispatch.dylib 0x19f03c604 _dispatch_call_block_and_release + 32
89 libdispatch.dylib 0x19f03e1c8 _dispatch_client_callout + 20
90 libdispatch.dylib 0x19f0412c8 _dispatch_queue_override_invoke + 784
91 libdispatch.dylib 0x19f04f8e8 _dispatch_root_queue_drain + 396
92 libdispatch.dylib 0x19f050104 _dispatch_worker_thread2 + 164
93 libsystem_pthread.dylib 0x19f1fe324 _pthread_wqthread + 228
94 libsystem_pthread.dylib 0x19f1fd080 start_wqthread + 8
Environment
- SwiftLint version (run
swiftlint version
to be sure)? 0.47.1 - Installation method used (Homebrew, CocoaPods, building from source, etc)? SwiftPM
- Paste your configuration file:
- Are you using nested configurations?
If so, paste their relative paths and respective contents. - Which Xcode version are you using (check
xcodebuild -version
)? Xcode 13.3.1 / Build version 13E500a - Do you have a sample that shows the issue? Run
echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
to quickly test if your example is really demonstrating the issue. If your example is more
complex, you can useswiftlint lint --path [file here] --no-cache --enable-all-rules
.
import Foundation
extension Bundle {
private class `_` {}
class var module: Self {
self.init(for: `_`.self)
}
}