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

[Source compatibility suite] vapor_jwt failing to build on macOS with release/6.1 -SIL verification failed: method does not appear in the class's vtable: VerifyClassMethodVisitor(member).Seen || operandType.isForeignReferenceType() #78870

Closed
justice-adams-apple opened this issue Jan 23, 2025 · 1 comment · Fixed by #78876 or #78877
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. source compatibility suite Flag: An issue that surfaced in the source compatibility suite triage needed This issue needs more specific labels

Comments

@justice-adams-apple
Copy link
Contributor

Description

vapor_jwt is failing to build on and internal/6.1 with the following error

error: compile command failed due to signal 6 (use -v to see invocation)
<unknown>:0: note: automatic synthesis of 'Hashable' is not supported for class declarations
SIL verification failed: method does not appear in the class's vtable: VerifyClassMethodVisitor(member).Seen || operandType.isForeignReferenceType()
Verifying instruction:
     %1 = load_borrow %0 : $*CFString             // users: %4, %3, %2
->   %2 = class_method %1 : $CFString, #CFString.hashValue!getter : (CFString) -> () -> Int, $@convention(method) (@guaranteed CFString) -> Int // user: %3
     %3 = apply %2(%1) : $@convention(method) (@guaranteed CFString) -> Int // user: %5
In function:
// protocol witness for Hashable.hashValue.getter in conformance CFStringRef
sil shared [transparent] [serialized] [thunk] [ossa] @$sSo11CFStringRefaSHSCSH9hashValueSivgTW : $@convention(witness_method: Hashable) (@in_guaranteed CFString) -> Int {
// %0                                             // user: %1
bb0(%0 : $*CFString):
  %1 = load_borrow %0 : $*CFString                // users: %4, %3, %2
  %2 = class_method %1 : $CFString, #CFString.hashValue!getter : (CFString) -> () -> Int, $@convention(method) (@guaranteed CFString) -> Int // user: %3
  %3 = apply %2(%1) : $@convention(method) (@guaranteed CFString) -> Int // user: %5
  end_borrow %1 : $CFString                       // id: %4
  return %3 : $Int                                // id: %5
} // end sil function '$sSo11CFStringRefaSHSCSH9hashValueSivgTW'

Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments:<ARGS>
1.	Apple Swift version 6.1-dev (LLVM 5f7c9060383ef80, Swift dc7459118d4caa3)
2.	Compiling with effective version 5.10
3.	While evaluating request ASTLoweringRequest(Lowering AST to SIL for file "/Users/ec2-user/jenkins/workspace/swift-6.1-source-compat-suite-debug/swift-source-compat-suite/project_cache/vapor_jwt/.build/checkouts/swift-certificates/Sources/X509/SecKeyWrapper.swift")
4.	While generating SIL witness table protocol conformance CFString: Hashable at 'CFString' (in module 'CoreFoundation')
5.	While generating protocol witness thunk SIL function "@$sSo11CFStringRefaSHSCSH9hashValueSivgTW".
 for getter for hashValue (in module 'CoreFoundation')
6.	While verifying SIL function "@$sSo11CFStringRefaSHSCSH9hashValueSivgTW".
 for getter for hashValue (in module 'CoreFoundation')
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x00000001102bf008 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 40
1  swift-frontend           0x00000001102bd0f8 llvm::sys::RunSignalHandlers() + 248
2  swift-frontend           0x00000001102bf67e SignalHandler(int) + 270
3  libsystem_platform.dylib 0x00007ff8066ba5ed _sigtramp + 29
4  libsystem_platform.dylib 0x000000011bd34080 _sigtramp + 18446603375235013296
5  libsystem_c.dylib        0x00007ff8065b3b45 abort + 123
6  swift-frontend           0x000000010a8a1869 swift::verificationFailure(llvm::Twine const&, swift::SILInstruction const*, swift::SILArgument const*, std::__1::function<void ()> const&) + 1337
7  swift-frontend           0x000000010a8c6a25 swift::SILVisitorBase<(anonymous namespace)::SILVerifier, void>::visitSILBasicBlock(swift::SILBasicBlock*) + 115125
8  swift-frontend           0x000000010a8aa7c2 (anonymous namespace)::SILVerifier::visitSILBasicBlock(swift::SILBasicBlock*) + 18
9  swift-frontend           0x000000010a8a8dab (anonymous namespace)::SILVerifier::visitSILFunction(swift::SILFunction*) + 13755
10 swift-frontend           0x000000010a8a1a3d swift::SILFunction::verify(swift::CalleeCache*, bool, bool, bool) const + 237
11 swift-frontend           0x0000000109f03159 swift::Lowering::SILGenFunction::emitProtocolWitness(swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::SILDeclRef, swift::SubstitutionMap, swift::SILDeclRef, swift::SubstitutionMap, swift::Lowering::IsFreeFunctionWitness_t, bool, bool, std::__1::optional<swift::ActorIsolation>) + 6777
12 swift-frontend           0x0000000109f365fd swift::Lowering::SILGenModule::emitProtocolWitness(swift::ProtocolConformanceRef, swift::SILLinkage, swift::SerializedKind_t, swift::SILDeclRef, swift::SILDeclRef, swift::Lowering::IsFreeFunctionWitness_t, swift::Witness) + 4461
13 swift-frontend           0x0000000109f393fd (anonymous namespace)::SILGenWitnessTable<(anonymous namespace)::SILGenConformance>::addMethodImplementation(swift::SILDeclRef, swift::SILDeclRef, swift::Witness) + 525
14 swift-frontend           0x0000000109f38ebe (anonymous namespace)::SILGenWitnessTable<(anonymous namespace)::SILGenConformance>::addMethod(swift::SILDeclRef) + 1262
15 swift-frontend           0x0000000109f3896f void llvm::function_ref<void (swift::AccessorDecl*)>::callback_fn<swift::SILWitnessVisitor<(anonymous namespace)::SILGenConformance>::visitAbstractStorageDecl(swift::AbstractStorageDecl*)::'lambda'(swift::AccessorDecl*)>(long, swift::AccessorDecl*) + 127
16 swift-frontend           0x000000010b03faf4 swift::AbstractStorageDecl::visitExpectedOpaqueAccessors(llvm::function_ref<void (swift::AccessorKind)>) const + 52
17 swift-frontend           0x000000010b03f92c swift::AbstractStorageDecl::visitOpaqueAccessors(llvm::function_ref<void (swift::AccessorDecl*)>) const + 44
18 swift-frontend           0x0000000109f38593 swift::SILWitnessVisitor<(anonymous namespace)::SILGenConformance>::visitProtocolDecl(swift::ProtocolDecl*) + 2195
19 swift-frontend           0x0000000109f352d0 swift::Lowering::SILGenModule::getWitnessTable(swift::NormalProtocolConformance*) + 368
20 swift-frontend           0x0000000109df578f swift::ASTLoweringRequest::evaluate(swift::Evaluator&, swift::ASTLoweringDescriptor) const + 1663
21 swift-frontend           0x0000000109f20b03 swift::SimpleRequest<swift::ASTLoweringRequest, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>> (swift::ASTLoweringDescriptor), (swift::RequestFlags)17>::evaluateRequest(swift::ASTLoweringRequest const&, swift::Evaluator&) + 115
22 swift-frontend           0x0000000109dfa8ae swift::ASTLoweringRequest::OutputType swift::Evaluator::getResultUncached<swift::ASTLoweringRequest, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'()>(swift::ASTLoweringRequest const&, swift::ASTLoweringRequest::OutputType swift::evaluateOrFatal<swift::ASTLoweringRequest>(swift::Evaluator&, swift::ASTLoweringRequest)::'lambda'()) + 318
23 swift-frontend           0x0000000109df5b87 swift::performASTLowering(swift::FileUnit&, swift::Lowering::TypeConverter&, swift::SILOptions const&, swift::IRGenOptions const*) + 103
24 swift-frontend           0x00000001096ccd45 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 677
25 swift-frontend           0x00000001096da87f withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 143
26 swift-frontend           0x00000001096cef95 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 949
27 swift-frontend           0x00000001096ce5bb swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2539
28 swift-frontend           0x0000000109470c56 swift::mainEntry(int, char const**) + 2550
29 dyld                     0x00007ff80633341f start + 1903

Reproduction

Using the source compat suite

./runner.py --swift-branch release/6.1 --projects projects.json --include-actions 'action.startswith("Build")' --include-repos 'path == "vapor_jwt"' --swiftc /Library/Developer/Toolchains/swift-6.1-DEVELOPMENT-SNAPSHOT-2025-01-22-a.xctoolchain/usr/bin/swiftc

Expected behavior

Expected the project to build correctly

Environment

https://ci.swift.org/view/Swift%206.1/job/swift-6.1-source-compat-suite-debug/3/artifact/swift-source-compat-suite/

Additional information

No response

@justice-adams-apple justice-adams-apple added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. source compatibility suite Flag: An issue that surfaced in the source compatibility suite triage needed This issue needs more specific labels labels Jan 23, 2025
justice-adams-apple added a commit to swiftlang/swift-source-compat-suite that referenced this issue Jan 23, 2025
justice-adams-apple added a commit to swiftlang/swift-source-compat-suite that referenced this issue Jan 23, 2025
@xedin
Copy link
Contributor

xedin commented Jan 24, 2025

This is actually an issue with MemberImportVisibility. @tshortli is looking into this. @justice-adams-apple we have a radar for this - rdar://142433039

@tshortli tshortli self-assigned this Jan 24, 2025
tshortli added a commit to tshortli/swift that referenced this issue Jan 24, 2025
MemberImportVisibility rules should only apply to source code in the main
module. The rules were being applied when resolving witnesses for synthesized
Hashable conformances on CF types imported by ClangImporter, which caused the
lookups to fail and bad conformances to be generated.

Resolves swiftlang#78870 and rdar://142433039.
tshortli added a commit to tshortli/swift that referenced this issue Jan 24, 2025
MemberImportVisibility rules should only apply to source code in the main
module. The rules were being applied when resolving witnesses for synthesized
Hashable conformances on CF types imported by ClangImporter, which caused the
lookups to fail and bad conformances to be generated.

Resolves swiftlang#78870 and rdar://142433039.
tshortli added a commit to tshortli/swift that referenced this issue Jan 24, 2025
MemberImportVisibility rules should only apply to source code in the main
module. The rules were being applied when resolving witnesses for synthesized
Hashable conformances on CF types imported by ClangImporter, which caused the
lookups to fail and bad conformances to be generated.

Resolves swiftlang#78870 and rdar://142433039.
tshortli added a commit to tshortli/swift that referenced this issue Jan 24, 2025
MemberImportVisibility rules should only apply to source code in the main
module. The rules were being applied when resolving witnesses for synthesized
Hashable conformances on CF types imported by ClangImporter, which caused the
lookups to fail and bad conformances to be generated.

Resolves swiftlang#78870 and rdar://142433039.
tshortli added a commit to tshortli/swift that referenced this issue Jan 24, 2025
MemberImportVisibility rules should only apply to source code in the main
module. The rules were being applied when resolving witnesses for synthesized
Hashable conformances on CF types imported by ClangImporter, which caused the
lookups to fail and bad conformances to be generated.

Resolves swiftlang#78870 and rdar://142433039.
justice-adams-apple added a commit to swiftlang/swift-source-compat-suite that referenced this issue Jan 28, 2025
* CoreStore - swiftlang/swift#78863

* Doggie - swiftlang/swift#70764

* exercism-swift - swiftlang/swift#78864

* Kingfisher - swiftlang/swift#78866

* Mapper - swiftlang/swift#65197

* Nimble - swiftlang/swift#57431

* ProcedureKit - swiftlang/swift#65197

* PromiseKit - swiftlang/swift#65197

* R.swift - swiftlang/swift#65204

* ReactiveSwift - swiftlang/swift#70744

* Serpent - swiftlang/swift#61615

* siesta - swiftlang/swift#57431

* SwiftLint-Legacy - swiftlang/swift#61616

* swift-protobuf-plugin-example - swiftlang/swift#65202

* vapor_websocket-kit - swiftlang/swift#75656

* vapor_jwt - swiftlang/swift#78870

* vapor_jwt-kit - swiftlang/swift#78870

* Deferred - swiftlang/swift#75498

* Kitura - rdar://83373628

* NetService - swiftlang/swift#64251

* penny-bot - https://github.com/swiftlang/swift/issues/75499

* Perfect - rdar://83373864

* SwiftLint - rdar://83374141

* violet - https://github.com/swiftlang/swift/issues/75499
xedin added a commit to xedin/swift-source-compat-suite that referenced this issue Jan 28, 2025
ttps://github.com/swiftlang/swift/issues/78870 has been fixes
on main and release/6.1 and the projects are currently UPASS'ing.
xedin added a commit to xedin/swift-source-compat-suite that referenced this issue Jan 28, 2025
swiftlang/swift#78870 has been fixes
on main and release/6.1 and the projects are currently UPASS'ing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. source compatibility suite Flag: An issue that surfaced in the source compatibility suite triage needed This issue needs more specific labels
Projects
None yet
3 participants