Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class X is implemented in both A and B. One of the two will be used. Which one is undefined. #4782

Closed
2 tasks done
egesucu opened this issue Feb 24, 2023 · 4 comments · Fixed by #4901
Closed
2 tasks done

Comments

@egesucu
Copy link

egesucu commented Feb 24, 2023

New Issue Checklist

Describe the bug

This will happen when you analyze the code with "swiftlint" or "swiftlint analyze". It will not break the build or give any crashes.

Complete output when running SwiftLint, including the stack trace and command used
objc[36713]: Class _TtC11SwiftSyntax16BumpPtrAllocator is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x10140c0d0) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x1051847c8). One of the two will be used. Which one is undefined.
objc[36713]: Class _TtC11SwiftSyntax35IncrementalParseReusedNodeCollector is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x10140c288) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x105184978). One of the two will be used. Which one is undefined.
objc[36713]: Class _TtC11SwiftSyntax26IncrementalParseTransition is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x10140c320) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x105184a10). One of the two will be used. Which one is undefined.
objc[36713]: Class _TtC11SwiftSyntax23SourceLocationConverter is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x10140e188) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x105184b50). One of the two will be used. Which one is undefined.
objc[36713]: Class _TtC11SwiftSyntax11SyntaxArena is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x10140e328) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x105184d70). One of the two will be used. Which one is undefined.
objc[36713]: Class _TtC11SwiftSyntax18ParsingSyntaxArena is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x10140e428) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x105184e70). One of the two will be used. Which one is undefined.
objc[36713]: Class _TtC11SwiftSyntax16SyntaxAnyVisitor is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x1014107d8) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x1051876f8). One of the two will be used. Which one is undefined.
objc[36713]: Class _TtC11SwiftSyntax14SyntaxRewriter is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x101414410) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x10518b7e8). One of the two will be used. Which one is undefined.
objc[36713]: Class _TtC11SwiftSyntax13SyntaxVisitor is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x101415720) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x10518c9d0). One of the two will be used. Which one is undefined.
...
Done linting! Found 0 violations, 0 serious in 26 files.

Environment

  • SwiftLint version: 0.50.3

  • Installation method used: Homebrew

  • Paste your configuration file: none

  • Are you using nested configurations? -none

  • Which Xcode version are you using?
    Xcode 14.3
    Build version 14E5197f

  • 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 use swiftlint lint --path [file here] --no-cache --enable-all-rules.

objc[37151]: Class _TtC11SwiftSyntax16BumpPtrAllocator is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x1039b40d0) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x1076ac7c8). One of the two will be used. Which one is undefined.
objc[37151]: Class _TtC11SwiftSyntax35IncrementalParseReusedNodeCollector is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x1039b4288) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x1076ac978). One of the two will be used. Which one is undefined.
objc[37151]: Class _TtC11SwiftSyntax26IncrementalParseTransition is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x1039b4320) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x1076aca10). One of the two will be used. Which one is undefined.
objc[37151]: Class _TtC11SwiftSyntax23SourceLocationConverter is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x1039b6188) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x1076acb50). One of the two will be used. Which one is undefined.
objc[37151]: Class _TtC11SwiftSyntax11SyntaxArena is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x1039b6328) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x1076acd70). One of the two will be used. Which one is undefined.
objc[37151]: Class _TtC11SwiftSyntax18ParsingSyntaxArena is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x1039b6428) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x1076ace70). One of the two will be used. Which one is undefined.
objc[37151]: Class _TtC11SwiftSyntax16SyntaxAnyVisitor is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x1039b87d8) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x1076af6f8). One of the two will be used. Which one is undefined.
objc[37151]: Class _TtC11SwiftSyntax14SyntaxRewriter is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x1039bc410) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x1076b37e8). One of the two will be used. Which one is undefined.
objc[37151]: Class _TtC11SwiftSyntax13SyntaxVisitor is implemented in both /opt/homebrew/Cellar/swiftlint/0.50.3/bin/swiftlint (0x1039bd720) and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftSyntax.dylib (0x1076b49d0). One of the two will be used. Which one is undefined.
The `anyobject_protocol` rule is now deprecated and will be completely removed in a future release.
@username0x0a
Copy link

username0x0a commented Apr 3, 2023

+1, just discovered it with 0.51.0 – SwiftLint called in Xcode via a Build step. Homebrew installation.

@mildm8nnered
Copy link
Collaborator

+1 - Seems to be Xcode 14.3 specific

@ZevEisenberg
Copy link
Contributor

Seeing this with 14.3 as well

keith added a commit that referenced this issue Apr 17, 2023
This uses a recent but unannounced (also read as private) feature of
dyld where it ignores duplicate Objective-C classes when they're in a
special format in the binary. https://github.com/apple-oss-distributions/dyld/blob/c8a445f88f9fc1713db34674e79b00e30723e79d/dyld/PrebuiltLoader.cpp#L1660-L1662

I think this is generally safe because hopefully people aren't actually
using the SwiftSyntax classes through the Objective-C runtime, but if
they are we'd still probably prefer to silence the noise and accept the
UB.

Fixes #4782
@keith
Copy link
Collaborator

keith commented Apr 17, 2023

🙈 #4901

keith added a commit that referenced this issue Apr 17, 2023
This uses a recent but unannounced (also read as private) feature of
dyld where it ignores duplicate Objective-C classes when they're in a
special format in the binary. https://github.com/apple-oss-distributions/dyld/blob/c8a445f88f9fc1713db34674e79b00e30723e79d/dyld/PrebuiltLoader.cpp#L1660-L1662

I think this is generally safe because hopefully people aren't actually
using the SwiftSyntax classes through the Objective-C runtime, but if
they are we'd still probably prefer to silence the noise and accept the
UB.

Fixes #4782
keith added a commit that referenced this issue Apr 17, 2023
This uses a recent but unannounced (also read as private) feature of
dyld where it ignores duplicate Objective-C classes when they're in a
special format in the binary. https://github.com/apple-oss-distributions/dyld/blob/c8a445f88f9fc1713db34674e79b00e30723e79d/dyld/PrebuiltLoader.cpp#L1660-L1662

I think this is generally safe because hopefully people aren't actually
using the SwiftSyntax classes through the Objective-C runtime, but if
they are we'd still probably prefer to silence the noise and accept the
UB.

Fixes #4782
jpsim pushed a commit that referenced this issue Apr 17, 2023
This uses a recent but unannounced (also read as private) feature of
dyld where it ignores duplicate Objective-C classes when they're in a
special format in the binary. https://github.com/apple-oss-distributions/dyld/blob/c8a445f88f9fc1713db34674e79b00e30723e79d/dyld/PrebuiltLoader.cpp#L1660-L1662

I think this is generally safe because hopefully people aren't actually
using the SwiftSyntax classes through the Objective-C runtime, but if
they are we'd still probably prefer to silence the noise and accept the
UB.

Fixes #4782
@keith keith mentioned this issue May 4, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants