Giter Site home page Giter Site logo

SingleCollectionViewProvider<Cell: UICollectionViewCell> Does not conform protocol UniqueAnimatableCollectionViewProvider - Swift compiler error segmentation fault 11 about flix HOT 11 OPEN

dianqk avatar dianqk commented on May 24, 2024
SingleCollectionViewProvider Does not conform protocol UniqueAnimatableCollectionViewProvider - Swift compiler error segmentation fault 11

from flix.

Comments (11)

10000TB avatar 10000TB commented on May 24, 2024

On a separate node (in case this is related) - After I "fixed" the protocol conformation issue, Flix will failed to compile in xcode 10.3 & swift 4.2 with a segmentation fault 11:

CompileSwift normal arm64 /Users/<username>/<project_name>/<projectname>-iOS/<folder1>/<folder2>/ThirdParty/Flix-3.0.0/TableViewEdit/TableViewInsertable.swift
    cd /Users/<username>/<project_name>/<projectname>-iOS/<folder1>
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -filelist /var/folders/fx/0fq_v8h53qqfzh44vdkxx7640000gn/T/sources-e90f24 -primary-file ....

(skipping sensitive info)

---
2.	While emitting IR SIL function "@$s9what2eats13RadioProviderCyqd__GAA033AnimatableCollectionViewMultiNodeC0A2aEP06createD5Nodes7RxSwift10ObservableCySayAA012IdentifiableH0VGGyFTW".
 for 'createAnimatableNodes()' (at /Users/xuehaodavidhu/what2eats/what2eats-iOS/what2eats/what2eats/ThirdParty/Flix-3.0.0/Provider/CollectionViewProvider.swift:190:12)
0  swift                    0x000000010aa3dee3 PrintStackTraceSignalHandler(void*) + 51
1  swift                    0x000000010aa3d6bc SignalHandler(int) + 348
2  libsystem_platform.dylib 0x00007fff77d06b5d _sigtramp + 29
3  libsystem_platform.dylib 0x00007f8fe0b44758 _sigtramp + 1759763480
4  swift                    0x00000001068eaee1 swift::irgen::FulfillmentMap::searchWitnessTable(swift::irgen::IRGenModule&, swift::CanType, swift::ProtocolDecl*, unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>*) + 65
5  swift                    0x00000001068eae52 swift::irgen::FulfillmentMap::searchWitnessTable(swift::irgen::IRGenModule&, swift::CanType, swift::ProtocolDecl*, unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&) + 450
6  swift                    0x00000001068eac58 void llvm::function_ref<void (unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>)>::callback_fn<swift::irgen::FulfillmentMap::searchNominalTypeMetadata(swift::irgen::IRGenModule&, swift::CanType, swift::MetadataState, unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&)::$_1>(long, unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>) + 1656
7  swift                    0x0000000106a3b77f swift::irgen::GenericTypeRequirements::enumerateFulfillments(swift::irgen::IRGenModule&, swift::SubstitutionMap, llvm::function_ref<void (unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>)>) + 335
8  swift                    0x00000001068e9e0a swift::irgen::FulfillmentMap::searchNominalTypeMetadata(swift::irgen::IRGenModule&, swift::CanType, swift::MetadataState, unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&) + 490
9  swift                    0x00000001068e9be8 swift::irgen::FulfillmentMap::searchTypeMetadata(swift::irgen::IRGenModule&, swift::CanType, swift::irgen::IsExact_t, swift::MetadataState, unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&) + 952
10 swift                    0x0000000106ae83aa swift::irgen::IRGenFunction::bindLocalTypeDataFromTypeMetadata(swift::CanType, swift::irgen::IsExact_t, llvm::Value*, swift::MetadataState) + 314
11 swift                    0x0000000106a39114 swift::irgen::emitPolymorphicParameters(swift::irgen::IRGenFunction&, swift::SILFunction&, swift::irgen::Explosion&, swift::irgen::WitnessMetadata*, llvm::function_ref<llvm::Value* (unsigned int)> const&) + 580
12 swift                    0x0000000106aa01c1 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 8049
13 swift                    0x000000010695f379 swift::irgen::IRGenerator::emitLazyDefinitions() + 1353
14 swift                    0x0000000106a80360 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**) + 1232
15 swift                    0x00000001068a21c9 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 49433
16 swift                    0x00000001068927de swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6862
17 swift                    0x000000010683087e main + 1246
18 libdyld.dylib            0x00007fff77b1b3d5 start + 1

from flix.

10000TB avatar 10000TB commented on May 24, 2024

Ok, looks like this is not going to get authors' attention any time soon

But for the record, want to share my debug findings anyway, in case other people also using this is scrambling their head trying to fix the same thing.

  1. Examples of from major releases of this project does not build
    Most of them failed at some protocol conformation issue, exactly like I posted above.

  2. Release 2.0.0 is having swift compiler crash issue (Xcode 10.2 & 10.3)
    They all appear to throw core dump as I posted above - could not figure out a fix to that - actually could not reason why it happened at first place, hope the author may have some clue when he noticed this thread @DianQK

  3. Release 4.0.0 dose not seem to build - some xconfig file issue

from flix.

DianQK avatar DianQK commented on May 24, 2024

Hi, @10000TB this error has fixed on 3.0.0. See 0734313#diff-7c7e5b8536101ffa202058a30b0416b9R86 .

I'm not sure why cause "segmentation fault 11", look like Swift's bug.

from flix.

DianQK avatar DianQK commented on May 24, 2024

Or you can use this branch https://github.com/DianQK/Flix/tree/release/2.0.1. I cannot build this for iOS 9 with Xcode 10, and I'm not sure why "Flix did not pass validation" for pod lint.

from flix.

10000TB avatar 10000TB commented on May 24, 2024

@DianQK To your first response - just verified that 3.0.0 does fix the protocol conformation issue (which seems to add onUpdate(..) right before configureCell(...)). but it still gives segmentation fault like following, and it looks like for 'createAnimatableNodes()' (in module 'Flix') is to blame:

Users/xuehaodavidhu/what2eats/what2eats-iOS/what2eats/what2eats/Views/OneGraySeparationThickCell.swift
/Users/xuehaodavidhu/what2eats/what2eats-iOS/what2eats/what2eats/Views/DishPostHeaderCell.swift
---
2.	While emitting IR SIL function "@$s9what2eats13RadioProviderCyqd__G4Flix033AnimatableCollectionViewMultiNodeC0AaeFP06createE5Nodes7RxSwift10ObservableCySayAE012IdentifiableI0VGGyFTW".
 for 'createAnimatableNodes()' (in module 'Flix')
0  swift                    0x000000010d4e3ee3 PrintStackTraceSignalHandler(void*) + 51
1  swift                    0x000000010d4e36bc SignalHandler(int) + 348
2  libsystem_platform.dylib 0x00007fff74fc7b5d _sigtramp + 29
3  libsystem_platform.dylib 0x00007f86935add68 _sigtramp + 509501992
4  swift                    0x0000000109390ee1 swift::irgen::FulfillmentMap::searchWitnessTable(swift::irgen::IRGenModule&, swift::CanType, swift::ProtocolDecl*, unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&, llvm::SmallPtrSetImpl<swift::ProtocolDecl*>*) + 65
5  swift                    0x0000000109390e52 swift::irgen::FulfillmentMap::searchWitnessTable(swift::irgen::IRGenModule&, swift::CanType, swift::ProtocolDecl*, unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&) + 450
6  swift                    0x0000000109390c58 void llvm::function_ref<void (unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>)>::callback_fn<swift::irgen::FulfillmentMap::searchNominalTypeMetadata(swift::irgen::IRGenModule&, swift::CanType, swift::MetadataState, unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&)::$_1>(long, unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>) + 1656
7  swift                    0x00000001094e177f swift::irgen::GenericTypeRequirements::enumerateFulfillments(swift::irgen::IRGenModule&, swift::SubstitutionMap, llvm::function_ref<void (unsigned int, swift::CanType, llvm::Optional<swift::ProtocolConformanceRef>)>) + 335
8  swift                    0x000000010938fe0a swift::irgen::FulfillmentMap::searchNominalTypeMetadata(swift::irgen::IRGenModule&, swift::CanType, swift::MetadataState, unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&) + 490
9  swift                    0x000000010938fbe8 swift::irgen::FulfillmentMap::searchTypeMetadata(swift::irgen::IRGenModule&, swift::CanType, swift::irgen::IsExact_t, swift::MetadataState, unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&) + 952
10 swift                    0x000000010958e3aa swift::irgen::IRGenFunction::bindLocalTypeDataFromTypeMetadata(swift::CanType, swift::irgen::IsExact_t, llvm::Value*, swift::MetadataState) + 314
11 swift                    0x00000001094df114 swift::irgen::emitPolymorphicParameters(swift::irgen::IRGenFunction&, swift::SILFunction&, swift::irgen::Explosion&, swift::irgen::WitnessMetadata*, llvm::function_ref<llvm::Value* (unsigned int)> const&) + 580
12 swift                    0x00000001095461c1 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 8049
13 swift                    0x0000000109405379 swift::irgen::IRGenerator::emitLazyDefinitions() + 1353
14 swift                    0x0000000109526360 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, swift::SourceFile*, llvm::GlobalVariable**) + 1232
15 swift                    0x00000001093481c9 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 49433
16 swift                    0x00000001093387de swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6862
17 swift                    0x00000001092d687e main + 1246
18 libdyld.dylib            0x00007fff74ddc3d5 start + 1
19 libdyld.dylib            0x0000000000000172 start + 233427702

from flix.

10000TB avatar 10000TB commented on May 24, 2024

@DianQK (Follow up from above - same using 3.0.0 branch) on a separate note, for the crash/swift compiler error

Adding this piece code into RadioProvider.swift magically solved the segmentation fault !!!!!!!!

    func createAnimatableNodes() -> Observable<[IdentifiableNode]> {
        let providerIdentity = self._flix_identity
        return createValues()
            .map { $0.map { IdentifiableNode(providerIdentity: providerIdentity, valueNode: $0) } }
    }

(code borrowed from 2.0.1 release branch)

from flix.

10000TB avatar 10000TB commented on May 24, 2024

(Accidentally clicked close - reopened it for @DianQK to make a decision on this)

from flix.

10000TB avatar 10000TB commented on May 24, 2024

(Also updated title to include segmentation fault, hope that will direct people here when they ran into same issue in the description)

from flix.

10000TB avatar 10000TB commented on May 24, 2024

For the linting issue - not sure what it is - but does not sound like a blocker if it is just style check

from flix.

DianQK avatar DianQK commented on May 24, 2024

I add some workaround methods. see #30 .

from flix.

10000TB avatar 10000TB commented on May 24, 2024

👍

from flix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.