MrHertal / react-native-twilio-phone

Twilio Voice React Native module.
MIT License
153 stars 66 forks source link

Segmentation fault: 11 when creating Archive on Mac Mini M1 #82

Open m4r00p opened 2 years ago

m4r00p commented 2 years ago

I'm trying to make an archive on mac mini m1 and when I'm building form arm64 I got the following compilation error:

Appreciate, any help, TIA!

`SwiftCodeGeneration normal arm64 (in target 'react-native-twilio-phone' from project 'Pods') cd /ios/Pods /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Library/Developer/Xcode/DerivedData/OpenUp-bqyryjunfcilcngctqxecbjnfnnw/Build/Intermediates.noindex/ArchiveIntermediates/OpenUp/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/react-native-twilio-phone.build/Objects-normal/arm64/TwilioPhone-e0e14b5551641bec664af814e9c97033.bc -embed-bitcode -target arm64-apple-ios11.0 -Xllvm -aarch64-use-tbi -O -disable-llvm-optzns -module-name react_native_twilio_phone -o /Library/Developer/Xcode/DerivedData/OpenUp-bqyryjunfcilcngctqxecbjnfnnw/Build/Intermediates.noindex/ArchiveIntermediates/OpenUp/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/react-native-twilio-phone.build/Objects-normal/arm64/TwilioPhone-e0e14b5551641bec664af814e9c97033.o Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace. Stack dump:

  1. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c -primary-file /Library/Developer/Xcode/DerivedData/OpenUp-bqyryjunfcilcngctqxecbjnfnnw/Build/Intermediates.noindex/ArchiveIntermediates/OpenUp/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/react-native-twilio-phone.build/Objects-normal/arm64/TwilioPhone-e0e14b5551641bec664af814e9c97033.bc -embed-bitcode -target arm64-apple-ios11.0 -Xllvm -aarch64-use-tbi -O -disable-llvm-optzns -module-name react_native_twilio_phone -o /Library/Developer/Xcode/DerivedData/OpenUp-bqyryjunfcilcngctqxecbjnfnnw/Build/Intermediates.noindex/ArchiveIntermediates/OpenUp/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/react-native-twilio-phone.build/Objects-normal/arm64/TwilioPhone-e0e14b5551641bec664af814e9c97033.o
  2. Apple Swift version 5.6 (swiftlang-5.6.0.323.62 clang-1316.0.20.8)
  3. Compiling with the current language version
  4. Running pass 'Function Pass Manager' on module '/Library/Developer/Xcode/DerivedData/OpenUp-bqyryjunfcilcngctqxecbjnfnnw/Build/Intermediates.noindex/ArchiveIntermediates/OpenUp/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/react-native-twilio-phone.build/Objects-normal/arm64/TwilioPhone-e0e14b5551641bec664af814e9c97033.bc'.
  5. Running pass 'ObjC ARC contraction' on function '@kTVODefaultAVAudioSessionConfigurationBlock_block_invoke' 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 0x000000010738ef88 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56 1 swift-frontend 0x000000010738df9c llvm::sys::RunSignalHandlers() + 112 2 swift-frontend 0x000000010738f618 SignalHandler(int) + 344 3 libsystem_platform.dylib 0x000000019321d4c4 _sigtramp + 56 4 swift-frontend 0x000000010530ce8c llvm::objcarc::BundledRetainClaimRVs::insertRVCallWithColors(llvm::Instruction, llvm::CallBase, llvm::DenseMap<llvm::BasicBlock, llvm::TinyPtrVector<llvm::BasicBlock>, llvm::DenseMapInfo<llvm::BasicBlock>, llvm::detail::DenseMapPair<llvm::BasicBlock, llvm::TinyPtrVector<llvm::BasicBlock> > > const&) + 64 5 swift-frontend 0x000000010531d878 (anonymous namespace)::ObjCARCContract::run(llvm::Function&, llvm::AAResults, llvm::DominatorTree) + 1024 6 swift-frontend 0x0000000107102e24 llvm::FPPassManager::runOnFunction(llvm::Function&) + 1292 7 swift-frontend 0x000000010710938c llvm::FPPassManager::runOnModule(llvm::Module&) + 60 8 swift-frontend 0x00000001071035a8 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1088 9 swift-frontend 0x00000001030ceee8 swift::performLLVMOptimizations(swift::IRGenOptions const&, llvm::Module, llvm::TargetMachine) + 3376 10 swift-frontend 0x00000001030cfe28 swift::performLLVM(swift::IRGenOptions const&, swift::DiagnosticEngine&, llvm::sys::SmartMutex, llvm::GlobalVariable, llvm::Module, llvm::TargetMachine, llvm::StringRef, swift::UnifiedStatsReporter) + 2440 11 swift-frontend 0x00000001030d8364 swift::performLLVM(swift::IRGenOptions const&, swift::ASTContext&, llvm::Module, llvm::StringRef) + 180 12 swift-frontend 0x0000000102c30ea0 swift::performFrontend(llvm::ArrayRef<char const>, char const, void, swift::FrontendObserver*) + 6976 13 swift-frontend 0x0000000102bf8130 swift::mainEntry(int, char const**) + 808 14 dyld 0x0000000109a7d088 start + 516 error: Segmentation fault: 11 (in target 'react-native-twilio-phone' from project 'Pods')`
yotamishak commented 2 years ago

I had the same problem exactly. Glad to see I am not alone

Downgrading to Xcode 13.2 can temporarily fix this.

m4r00p commented 2 years ago

Awesome thank You!!! 13.2 works butter smooth! Let's then wait on the fix for 13.3.

se1exin commented 2 years ago

I was getting this error as well with Xcode 13.3 on an Intel Mac. Disabling Bitcode in my project and in all pods via the following addition to my Podfile got past the issue:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ENABLE_BITCODE'] = 'NO'
        end
    end
end
yotamishak commented 2 years ago

@se1exin Nice catch! We want to use bitcode in production so it won't solve it for us, but this may point to the source of the problem.