Open JaviSoto opened 4 years ago
@swift-ci create
I tried to see if it was reproducible with an Xcode snapshot from Swift.org, but it seems those have been broken since January: https://forums.swift.org/t/swift-5-2-snapshot-error/32544/8
(Still an issue on Beta 3)
The final build of Xcode 11.4 still has this issue, albeit it happens way less frequently.
But I realized it always happens in the same property. Here's the code of such property:
private var sendOrCancelButtonVisible = false {
didSet {
guard oldValue != sendOrCancelButtonVisible else {
return
}
UIView.animate(withDuration: sendOrCancelButtonVisible ? TWViewAppearanceAnimationDuration : TWViewDismissalAnimationDuration) {
self.sendOrCancelButton.alpha = self.sendOrCancelButtonVisible ? 1.0 : 0.0
self.activeSendOrCancelButtonConstraint = self.sendOrCancelButtonVisible
? self.sendOrCancelButtonConstraints.visible
: self.sendOrCancelButtonConstraints.hidden
self.layoutIfNeeded()
}
}
}
TWViewAppearanceAnimationDuration
is a #define
in a header imported through the bridging header. TWViewDismissalAnimationDuration
is an extern const
defined in another header.
We hit another seg fault 11 in a different file, only when building against an iOS device instead of simulator. Also pointing to a method that references a #define
declared in a header imported in the bridging header. If we change the #define
to a extern const
, the crash goes away. I'm not able to repro in an empty project though 🙁 Here's the crash details of that one:
---
3. While emitting IR SIL function "@$sSo10UITextViewC6TwitchE11applyEmotes33_ACB92AEF86377123BBFC1EFCF6DB010ELL5using20withPlaceholderTheme20consideringSelectionSbAC16ChatEmoteManagerC_So7TWTheme_pSbtFySS_So8_NSRangeVSbztXEfU_".
for expression at [/Users/jsbustos/Documents/Projects/twitch-iphone/Twitch.tv/Code/Controllers/Chat/ChatViewController.swift:992:73 - line:1050:9] RangeText="" /* some code here */
0 swift 0x00000001115174ea PrintStackTraceSignalHandler(void*) + 42
1 swift 0x0000000111516cc0 SignalHandler(int) + 352
2 libsystem_platform.dylib 0x00007fff6ee1942d _sigtramp + 29
3 libsystem_platform.dylib 0x00007fb62a76b1a8 _sigtramp + 3147111832
4 swift 0x000000010d2e29ea llvm::CallInst::Create(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&, llvm::Instruction*) + 490
5 swift 0x000000010d2f990e llvm::IRBuilder<llvm::ConstantFolder, llvm::IRBuilderDefaultInserter>::CreateCall(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, llvm::Twine const&, llvm::MDNode*) + 62
6 swift 0x000000010d2f95fa swift::irgen::IRBuilder::CreateCall(swift::irgen::FunctionPointer const&, llvm::ArrayRef<llvm::Value*>) + 378
7 swift 0x000000010d2f7a9d swift::irgen::CallEmission::emitCallSite() + 157
8 swift 0x000000010d2faa50 swift::irgen::CallEmission::emitToExplosion(swift::irgen::Explosion&, bool) + 2624
9 swift 0x000000010d4be1c0 (anonymous namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 2352
10 swift 0x000000010d49e8e3 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 8835
11 swift 0x000000010d352032 swift::irgen::IRGenerator::emitGlobalTopLevel() + 1410
12 swift 0x000000010d47ced9 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**) + 1097
13 swift 0x000000010d27436f performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 4255
14 swift 0x000000010d2697c0 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 48416
15 swift 0x000000010d1e14d3 main + 1283
16 libdyld.dylib 0x00007fff6ec207fd start + 1
17 libdyld.dylib 0x000000000000016f start + 2436757875
error: Segmentation fault: 11 (in target 'Twitch' from project 'Twitch')
Environment
Xcode 11.4 / Swift 5.2Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | | |Labels | Bug, CompilerCrash | |Assignee | None | |Priority | Medium | md5: f883833f3f98ed1026f712d62e5145bdIssue Description:
I've been seeing this since Xcode 11.4 Beta 1, and I'm still seeing it with Beta 3. I didn't have time until now to diagnose a bit more and file the bug report. This is also an intermittent issue. It seems that deleting derived data, closing Xcode and reopening it, and compiling again sometimes makes it work. Which makes me wonder whether this is an issue with having build artifacts in Derived Data produced by Xcode 11.3, and then try to build with 11.4?
It also doesn't seem related to the specific file that it fails on, because if I comment out the code in it, it will just happen on the next one.
This is the build command: