Skip to content

Including BaseMath in Xcode project crashes build #14

Description

@porterchild

Not sure if I'm doing something wrong or things just haven't been updated in a while, but when I try to use BaseMath in an Xcode project (toolchain 11.3.1), BaseMath produces a Segmentation Fault while building. I also tried using SwiftyMKL but it didn't build, probably because it depends on BaseMath.

Output:

`CompileSwift normal x86_64 (in target 'BaseMath' from project 'BaseMath')
cd /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/SourcePackages/checkouts/BaseMath
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/SourcePackages/checkouts/BaseMath/Sources/BaseMath/BaseMath.swift /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/SourcePackages/checkouts/BaseMath/Sources/BaseMath/BaseVector.swift /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/SourcePackages/checkouts/BaseMath/Sources/BaseMath/Storage.swift -emit-module-path /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/BaseMath.swiftmodule -emit-module-doc-path /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/BaseMath.swiftdoc -serialize-diagnostics-path /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/BaseMath-master.dia -emit-dependencies-path /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/BaseMath-master.d -target x86_64-apple-macos10.10 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Products/Release -F /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Products/Release -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -g -module-cache-path /Users/porter/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -O -D SWIFT_PACKAGE -D Xcode -serialize-debugging-options -Xcc -working-directory -Xcc /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/SourcePackages/checkouts/BaseMath -Xcc -fmodule-map-file=/Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/GeneratedModuleMaps/macosx/CBaseMath.modulemap -Xcc -I/Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/SourcePackages/checkouts/BaseMath/Sources/CBaseMath/include -Xcc -I/Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Products/Release/include -Xcc -I/Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/DerivedSources-normal/x86_64 -Xcc -I/Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/DerivedSources/x86_64 -Xcc -I/Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/DerivedSources -Xcc -DSWIFT_PACKAGE -module-name BaseMath -num-threads 4 -o /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/BaseMath.o -o /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/BaseVector.o -o /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/Storage.o

Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/SourcePackages/checkouts/BaseMath/Sources/BaseMath/BaseMath.swift /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/SourcePackages/checkouts/BaseMath/Sources/BaseMath/BaseVector.swift /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/SourcePackages/checkouts/BaseMath/Sources/BaseMath/Storage.swift -emit-module-path /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/BaseMath.swiftmodule -emit-module-doc-path /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/BaseMath.swiftdoc -serialize-diagnostics-path /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/BaseMath-master.dia -emit-dependencies-path /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/BaseMath-master.d -target x86_64-apple-macos10.10 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Products/Release -F /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Products/Release -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -g -module-cache-path /Users/porter/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -O -D SWIFT_PACKAGE -D Xcode -serialize-debugging-options -Xcc -working-directory -Xcc /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/SourcePackages/checkouts/BaseMath -Xcc -fmodule-map-file=/Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/GeneratedModuleMaps/macosx/CBaseMath.modulemap -Xcc -I/Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/SourcePackages/checkouts/BaseMath/Sources/CBaseMath/include -Xcc -I/Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Products/Release/include -Xcc -I/Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/DerivedSources-normal/x86_64 -Xcc -I/Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/DerivedSources/x86_64 -Xcc -I/Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/DerivedSources -Xcc -DSWIFT_PACKAGE -module-name BaseMath -num-threads 4 -o /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/BaseMath.o -o /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/BaseVector.o -o /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/Build/Intermediates.noindex/BaseMath.build/Release/BaseMath.build/Objects-normal/x86_64/Storage.o

  1. While emitting IR SIL function "@$s8BaseMath14AlignedStorageCyqd__GAA0A6VectorA2aEP7tgamma_yyFTW".
    for 'tgamma_()' (at /Users/porter/Library/Developer/Xcode/DerivedData/Speedy_SIMD-hiqzpgznqfvwceggcnvkkpevvzsq/SourcePackages/checkouts/BaseMath/Sources/BaseMath/BaseVector.swift:807:21)
    0 swift 0x00000001098b6a63 PrintStackTraceSignalHandler(void*) + 51
    1 swift 0x00000001098b6236 SignalHandler(int) + 358
    2 libsystem_platform.dylib 0x00007fff6943542d _sigtramp + 29
    3 libsystem_platform.dylib 0x00007ffeea7990f0 _sigtramp + 2167815392
    4 swift 0x000000010556d9b1 swift::irgen::FulfillmentMap::searchWitnessTable(swift::irgen::IRGenModule&, swift::CanType, swift::ProtocolDecl*, unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&, llvm::SmallPtrSetImplswift::ProtocolDecl*) + 65
    5 swift 0x000000010556d922 swift::irgen::FulfillmentMap::searchWitnessTable(swift::irgen::IRGenModule&, swift::CanType, swift::ProtocolDecl
    , unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&) + 450
    6 swift 0x000000010556d728 void llvm::function_ref<void (unsigned int, swift::CanType, llvm::Optionalswift::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::Optionalswift::ProtocolConformanceRef) + 1656
    7 swift 0x00000001056ce71f swift::irgen::GenericTypeRequirements::enumerateFulfillments(swift::irgen::IRGenModule&, swift::SubstitutionMap, llvm::function_ref<void (unsigned int, swift::CanType, llvm::Optionalswift::ProtocolConformanceRef)>) + 335
    8 swift 0x000000010556c8ee swift::irgen::FulfillmentMap::searchNominalTypeMetadata(swift::irgen::IRGenModule&, swift::CanType, swift::MetadataState, unsigned int, swift::irgen::MetadataPath&&, swift::irgen::FulfillmentMap::InterestingKeysCallback const&) + 478
    9 swift 0x000000010556c6d0 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&) + 912
    10 swift 0x0000000105780c9d swift::irgen::IRGenFunction::bindLocalTypeDataFromTypeMetadata(swift::CanType, swift::irgen::IsExact_t, llvm::Value*, swift::MetadataState) + 317
    11 swift 0x00000001056cc674 swift::irgen::emitPolymorphicParameters(swift::irgen::IRGenFunction&, swift::SILFunction&, swift::irgen::Explosion&, swift::irgen::WitnessMetadata*, llvm::function_ref<llvm::Value* (unsigned int)> const&) + 596
    12 swift 0x0000000105737cf5 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 6293
    13 swift 0x00000001055e69e7 swift::irgen::IRGenerator::emitLazyDefinitions() + 9303
    14 swift 0x000000010571358a swift::performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_deleteswift::SILModule >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::LLVMContext&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, llvm::GlobalVariable**) + 2266
    15 swift 0x00000001055008fe performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 36542
    16 swift 0x00000001054f4234 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 6820
    17 swift 0x0000000105481733 main + 1219
    18 libdyld.dylib 0x00007fff6923c7fd start + 1
    19 libdyld.dylib 0x0000000000000041 start + 2531014725
    error: Segmentation fault: 11 (in target 'BaseMath' from project 'BaseMath')`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions