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

[SR-7287] ReSwift 3.0 source breakage: Assertion failed: (rootWTable && "root witness table not bound in local context!") #49835

Closed
clackary opened this issue Mar 27, 2018 · 4 comments

Comments

@clackary
Copy link
Contributor

clackary commented Mar 27, 2018

Previous ID SR-7287
Radar None
Original Reporter @clackary
Type Bug
Status Closed
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, SourceCompatibility
Assignee None
Priority Medium

md5: a52931ef2c00716c1a6ef50b7722dab0

duplicates:

  • SR-7285 ReSwift fails in Source Compat

Issue Description:

To reproduce:

  1. Install latest GM/Beta Xcode
  2. $ git clone git@github.com:apple/swift-source-compat-suite.git
  3. $ cd swift-source-compat-suite

To build Swift from scratch before testing:
4. $ ./reproduce.py master --project-path ReSwift

Or if you've already built Swift:
4. $ ./reproduce.py master --project-path ReSwift --swiftc path/to/swiftc

CI log: FAIL_ReSwift-ReSwift.xcodeproj_3.0_BuildXcodeProjectScheme_ReSwift-iOS_generic-platform-iOS.log

Assertion failed: (rootWTable && "root witness table not bound in local context!"), function emitArchetypeWitnessTableRef, file /Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/swift/lib/IRGen/GenArchetype.cpp, line 284.
0  swift                    0x0000000110758958 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x0000000110758fe6 SignalHandler(int) + 422
2  libsystem_platform.dylib 0x00007fff704abf5a _sigtramp + 26
3  swift                    0x000000010e00a672 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 66
4  libsystem_c.dylib        0x00007fff702d6312 abort + 127
5  libsystem_c.dylib        0x00007fff7029e368 basename_r + 0
6  swift                    0x000000010cdab144 swift::irgen::emitArchetypeWitnessTableRef(swift::irgen::IRGenFunction&, swift::CanTypeWrapper<swift::ArchetypeType>, swift::ProtocolDecl*) + 1860
7  swift                    0x000000010ce7fefb swift::irgen::emitWitnessTableRef(swift::irgen::IRGenFunction&, swift::CanType, llvm::Value**, swift::ProtocolConformanceRef) + 123
8  swift                    0x000000010ce7fe6f swift::irgen::emitWitnessTableRef(swift::irgen::IRGenFunction&, swift::CanType, swift::ProtocolConformanceRef) + 31
9  swift                    0x000000010cf2454c void llvm::function_ref<void (unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>)>::callback_fn<(anonymous namespace)::GenericArguments::collect(swift::irgen::IRGenFunction&, swift::CanType)::'lambda'(unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>)>(long, unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>) + 44
10 swift                    0x000000010ce80b55 swift::irgen::GenericTypeRequirements::enumerateFulfillments(swift::irgen::IRGenModule&, swift::SubstitutionMap const&, llvm::function_ref<void (unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>)>) + 261
11 swift                    0x000000010cf242c6 emitNominalMetadataRef(swift::irgen::IRGenFunction&, swift::NominalTypeDecl*, swift::CanType, swift::irgen::DynamicMetadataRequest) + 486
12 swift                    0x000000010cf20fab emitDirectTypeMetadataRef(swift::irgen::IRGenFunction&, swift::CanType, swift::irgen::DynamicMetadataRequest) + 427
13 swift                    0x000000010cf20cfe swift::irgen::IRGenFunction::emitTypeMetadataRef(swift::CanType, swift::irgen::DynamicMetadataRequest) + 126
14 swift                    0x000000010cf22229 swift::CanTypeVisitor<(anonymous namespace)::EmitTypeMetadataRefForLayout, llvm::Value*, swift::irgen::DynamicMetadataRequest>::visit(swift::CanType, swift::irgen::DynamicMetadataRequest) + 137
15 swift                    0x000000010cf25d4a llvm::Value* llvm::function_ref<llvm::Value* (swift::CanType, swift::irgen::DynamicMetadataRequest)>::callback_fn<(anonymous namespace)::EmitTypeMetadataRefForLayout::visitTupleType(swift::CanTypeWrapper<swift::TupleType>, swift::irgen::DynamicMetadataRequest)::'lambda'(swift::CanType, swift::irgen::DynamicMetadataRequest)>(long, swift::CanType, swift::irgen::DynamicMetadataRequest) + 90
16 swift                    0x000000010cf23932 emitTupleTypeMetadataRef(swift::irgen::IRGenFunction&, swift::CanTypeWrapper<swift::TupleType>, swift::irgen::DynamicMetadataRequest, bool, llvm::function_ref<llvm::Value* (swift::CanType, swift::irgen::DynamicMetadataRequest)>) + 706
17 swift                    0x000000010cf22486 swift::CanTypeVisitor<(anonymous namespace)::EmitTypeMetadataRefForLayout, llvm::Value*, swift::irgen::DynamicMetadataRequest>::visit(swift::CanType, swift::irgen::DynamicMetadataRequest) + 742
18 swift                    0x000000010cf220a5 swift::irgen::IRGenFunction::emitTypeMetadataRefForLayout(swift::SILType) + 101
19 swift                    0x000000010cea4989 (anonymous namespace)::TupleNonFixedOffsets::getOffsetForIndex(swift::irgen::IRGenFunction&, unsigned int) + 25
20 swift                    0x000000010cf2722d swift::irgen::ElementLayout::project(swift::irgen::IRGenFunction&, swift::irgen::Address, llvm::Optional<swift::irgen::NonFixedOffsetsImpl*>, llvm::Twine const&) const + 141
21 swift                    0x000000010cea4264 swift::irgen::RecordTypeInfoImpl<(anonymous namespace)::NonFixedTupleTypeInfo, swift::irgen::WitnessSizedTypeInfo<(anonymous namespace)::NonFixedTupleTypeInfo>, (anonymous namespace)::TupleFieldInfo, false>::destroy(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::SILType, bool) const + 548
22 swift                    0x000000010ce03122 void llvm::function_ref<void (swift::irgen::IRGenFunction&)>::callback_fn<swift::irgen::IRGenModule::generateCallToOutlinedDestroy(swift::irgen::IRGenFunction&, swift::irgen::TypeInfo const&, swift::irgen::Address, swift::SILType, llvm::MapVector<swift::CanType, llvm::Value*, llvm::DenseMap<swift::CanType, unsigned int, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, unsigned int> >, std::__1::vector<std::__1::pair<swift::CanType, llvm::Value*>, std::__1::allocator<std::__1::pair<swift::CanType, llvm::Value*> > > > const*)::$_6>(long, swift::irgen::IRGenFunction&) + 162
23 swift                    0x000000010cdfc495 swift::irgen::IRGenModule::getOrCreateHelperFunction(llvm::StringRef, llvm::Type*, llvm::ArrayRef<llvm::Type*>, llvm::function_ref<void (swift::irgen::IRGenFunction&)>, bool) + 293
24 swift                    0x000000010cdfd1e9 swift::irgen::IRGenModule::generateCallToOutlinedDestroy(swift::irgen::IRGenFunction&, swift::irgen::TypeInfo const&, swift::irgen::Address, swift::SILType, llvm::MapVector<swift::CanType, llvm::Value*, llvm::DenseMap<swift::CanType, unsigned int, llvm::DenseMapInfo<swift::CanType>, llvm::detail::DenseMapPair<swift::CanType, unsigned int> >, std::__1::vector<std::__1::pair<swift::CanType, llvm::Value*>, std::__1::allocator<std::__1::pair<swift::CanType, llvm::Value*> > > > const*) + 985
25 swift                    0x000000010cea4109 swift::irgen::RecordTypeInfoImpl<(anonymous namespace)::NonFixedTupleTypeInfo, swift::irgen::WitnessSizedTypeInfo<(anonymous namespace)::NonFixedTupleTypeInfo>, (anonymous namespace)::TupleFieldInfo, false>::destroy(swift::irgen::IRGenFunction&, swift::irgen::Address, swift::SILType, bool) const + 201
26 swift                    0x000000010cee322f swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 8207
27 swift                    0x000000010cdf2c4b swift::irgen::IRGenerator::emitLazyDefinitions() + 1051
28 swift                    0x000000010cebc8e6 swift::performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, llvm::GlobalVariable**) + 1878
29 swift                    0x000000010cd5584f performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 15535
30 swift                    0x000000010cd50b8e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3310
31 swift                    0x000000010cd0ee83 main + 2051
32 libdyld.dylib            0x00007fff7022a115 start + 1
33 libdyld.dylib            0x0000000000000060 start + 2413649740
Assertion failed: (isASTNode()), function castToASTNode, file /Users/buildnode/jenkins/workspace-private/swift-master-source-compat-suite/swift/include/swift/SIL/SILLocation.h, line 395.
@clackary
Copy link
Contributor Author

clackary commented Mar 27, 2018

This started failing as of https://ci.swift.org/job/swift-master-source-compat-suite/1515/

These are the changes in this build:

  1. Basic plumbing to propagate metadata-generation results in IRGen. (detail)

  2. Pull TypeInfo::initializeMetadata into GenMeta; NFC. (detail)

  3. Extract MetadataRequest::BasicKind as MetadataState. NFC. (detail)

  4. Accomodate values with non-trivial constructors in PrefixMap. (detail)

  5. Restructure how we finalize VWTs in the runtime to potentially allow (detail)

  6. Expose the bit-layout of a MetadataRequest for use by IRGen. (detail)

  7. Add a runtime function to query the current runtime state of a metadata. (detail)

  8. Allow type metadata to be incomplete. (detail)

  9. [local] Convert llvm::none_of negative condition => llvm::all_of (detail)

@clackary
Copy link
Contributor Author

clackary commented Mar 27, 2018

Ah, looks like the forum post has a pretty good layout of the change log as well...

@belkadan
Copy link
Contributor

belkadan commented Mar 28, 2018

@rjmccall, looks like this is yours!

@clackary
Copy link
Contributor Author

clackary commented Mar 28, 2018

No longer failing in source compat suite. Thanks!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants