简体   繁体   English

分段故障:11 xcode 12.4

[英]Segmentation fault: 11 xcode 12.4

We have updated the xcode version 11.6 to 12.4 last week.上周我们已将 xcode 版本 11.6 更新至 12.4。 Everything was working perfectly.一切都运行良好。 After this update, We are getting this issue.在此更新之后,我们遇到了这个问题。 We tried these steps:我们尝试了以下步骤:

-clean / re-build
-removed derived data
-removed valid-archs from build settings
-added arm64 to Excluded Architectures
-reboot mac

Still we are facing same issue.我们仍然面临同样的问题。 These logs doesn't give proper information of the class where we need change.这些日志没有提供我们需要更改的 class 的正确信息。 These are the error logs we are getting when we try to run the app:这些是我们在尝试运行应用程序时得到的错误日志:

0 swift 0x000000010984e615 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1 swift 0x000000010984d615 llvm::sys::RunSignalHandlers() + 85
2 swift 0x000000010984ebcf SignalHandler(int) + 111
3 libsystem_platform.dylib 0x00007fff70f0f5fd _sigtramp + 29
4 libsystem_platform.dylib 0x00007f8a8a354900 _sigtramp + 18446743571622286112
5 swift 0x00000001057c537b emitApplyArgument((anonymous namespace)::IRGenSILFunction&, 
swift::SILValue, swift::SILType, swift::irgen::Explosion&) + 283
6 swift 0x00000001057c441a (anonymous 
namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 3770
7 swift 0x00000001057a2d26 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 8982
8 swift 0x000000010563b457 
swift::irgen::IRGenerator::emitGlobalTopLevel(llvm::StringSet<llvm::MallocAllocator>*) + 1607
9 swift 0x0000000105777c37 performIRGeneration(swift::IRGenOptions const&, swift::ModuleDecl, 
std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, 
swift::PrimarySpecificPaths const&, llvm::StringRef, swift::SourceFile, llvm::GlobalVariable*, 
llvm::StringSet<llvm::MallocAllocator>) + 1687
10 swift 0x00000001057a0781 swift::SimpleRequest<swift::IRGenSourceFileRequest, 
swift::GeneratedModule (swift::IRGenDescriptor), 
(swift::RequestFlags)9>::evaluateRequest(swift::IRGenSourceFileRequest const&, swift::Evaluator&) + 
97
11 swift 0x000000010577c04c llvm::Expected<swift::IRGenSourceFileRequest::OutputType> 
swift::Evaluator::getResultUncached<swift::IRGenSourceFileRequest>(swift::IRGenSourceFileRequest 
const&) + 940
12 swift 0x000000010577829d swift::performIRGeneration(swift::IRGenOptions const&, 
swift::SourceFile&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> 
>, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::GlobalVariable*, 
llvm::StringSet<llvm::MallocAllocator>) + 269
13 swift 0x00000001053c21ba performCompileStepsPostSILGen(swift::CompilerInstance&, 
swift::CompilerInvocation const&, std::__1::unique_ptr<swift::SILModule, 
std::__1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl, 
swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver) + 3002
14 swift 0x00000001053b1d97 swift::performFrontend(llvm::ArrayRef<char const*>, char const, void, 
swift::FrontendObserver*) + 20695
15 swift 0x0000000105332c27 main + 1255
16 libdyld.dylib 0x00007fff70d12cc9 start + 1
17 libdyld.dylib 0x00000000000001ac start + 18446603338623407332

error: Segmentation fault: 11 (in target 'ProjectName' from project 'ProjectName')

Errors错误

These are the pods we are using:这些是我们正在使用的 pod:

pod 'p2.OAuth2', '~> 3.0.0'
pod 'SwiftyJSON', '~> 3.0.0'
pod 'CryptoSwift', '0.8.3'

How we can fix this?我们如何解决这个问题? Any help appreciated.任何帮助表示赞赏。

thanks.谢谢。

Recently, I've also done upgrade from Xcode 11.7 to 12.4 and got the same Segmentation fault: 11 error on so many Swift files in my project and the weird part is, most of the times those error doesn't have proper description or reasoning.最近,我还完成了从 Xcode 11.7 到 12.4 的升级,并得到了相同的Segmentation fault: 11我的项目中这么多Swift文件出现 11 错误,奇怪的是,大多数时候这些错误没有正确的描述或推理.

I have spent around a week on this and found a solution which worked for me.我花了大约一个星期的时间,找到了一个对我有用的解决方案。

There's one BUILD setting called SWIFT_COMPILATION_MODE , just set this property to Whole Module and build your project.有一个BUILD设置称为SWIFT_COMPILATION_MODE ,只需将此属性设置为Whole Module并构建您的项目。 Now XCode will start giving you error with some understandable description.现在 XCode 将开始给你一些可以理解的描述错误。 You can go ahead fix those error.您可以提前 go 修复这些错误。

Once you resolved these errors, you can set this property back to it's previous value ie Incremental一旦你解决了这些错误,你可以将此属性设置回它以前的值,即Incremental

在此处输入图像描述

NOTE: It still won't give you the error line number but it will give you the class & method name where this error lies, also the error count will get reduced to the actual count.注意:它仍然不会为您提供错误行号,但会为您提供 class 和此错误所在的方法名称,错误计数也会减少到实际计数。 You can comment all the lines in that function and try to uncomment one (or more) at a time and build your project to find out the problematic line.您可以注释 function 中的所有行,并尝试一次取消注释一个(或多个)并构建您的项目以找出有问题的行。

This is how I'm able to resolved these errors, hope this helps you in resolving yours.这就是我能够解决这些错误的方法,希望这可以帮助您解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM