realm / realm/SwiftLint

Fatal error while scanning apple/swift repo

Open
#4,821 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Swift
Stars
19.7k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
11

Description

New Issue Checklist
Describe the bug

SwiftLint docker crashes when I scan https://github.com/apple/swift:

  • git clone https://github.com/apple/swift
  • cd swift
  • docker run -it -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:0.50.3
Output (only stack trace, full output is huge)
SourceKittenFramework/File.swift:20: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=261 "The specified text encoding isn’t applicable."
Current stack trace:
0                                       0x0000559b02f09170 <unavailable> + 30679408
1                                       0x0000559b02bdfa9c <unavailable> + 27363996
2                                       0x0000559b02bdf8b8 <unavailable> + 27363512
3                                       0x0000559b02bde543 <unavailable> + 27358531
4                                       0x0000559b02c3362c <unavailable> + 27706924
5                                       0x0000559b01d4cb03 <unavailable> + 12081923
6                                       0x0000559b02af654c <unavailable> + 26408268
7                                       0x0000559b02aec4c9 <unavailable> + 26367177
8                                       0x0000559b02b0a0fa <unavailable> + 26489082
9                                       0x0000559b02af64c2 <unavailable> + 26408130
10                                      0x0000559b01d4ca00 File.contents.getter + 35
11                                      0x0000559b01df9ba4 <unavailable> + 12790692
12                                      0x0000559b01dfaa6d <unavailable> + 12794477
13                                      0x0000559b01dfaa20 CollectedLinter.styleViolations(using:) + 8
14                                      0x0000559b0257a3fd <unavailable> + 20657149
15                                      0x0000559b02bbc67e <unavailable> + 27219582
16                                      0x0000559b02bbcd6c <unavailable> + 27221356
17                                      0x0000559b02b00845 <unavailable> + 26449989
18                                      0x0000559b02b005f3 <unavailable> + 26449395
19                                      0x0000559b02b0bee2 <unavailable> + 26496738
20   libc.so.6                          0x00007f436e330b43 <unavailable> + 609091
21   libc.so.6                          0x00007f436e3c1b70 clone + 68
Environment
  • Ubuntu 22.04 (fully updated)
  • Docker version 23.0.1, build a5ee5b1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported Docker scan against apple/swift, then inspect SourceKittenFramework/File.swift around line 20, identified by the stack trace. Determine which input triggers NSCocoaErrorDomain 261, and verify that scanning the repository completes without the fatal error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, swift
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.