You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Xcode 11.3.1 (11C505) and Xcode 11.4 (11E146) on macOS 10.15.4 (19E266)
Additional Detail from JIRA
Votes
2
Component/s
Compiler
Labels
Bug
Assignee
None
Priority
Medium
md5: 2ca56ae0633ba678a44236ae721150b2
Issue Description:
I've isolated this down as much as I can. I don't understand what all the Terminal command parameters do; I found them by grabbing the swift invocation from an Xcode project and removing as many parameters as I could while still reproducing the issue.
swift -frontend -c -primary-file ~/Desktop/crash.swift -target x86_64-apple-ios12.0-simulator -sdk /Applications/Xcode_11.4.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk -profile-generate -profile-coverage-mapping
Stack dump:
0. Program arguments: /Applications/Xcode_11.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/211518/Desktop/crash.swift -target x86_64-apple-ios12.0-simulator -sdk /Applications/Xcode_11.4.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk -profile-generate -profile-coverage-mapping
1. Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)
2. While silgen emitConstructor SIL function"@$s5crash8NewThingV3fooACSd_tcfC".for'init(foo:)' (at /Users/211518/Desktop/crash.swift:7:5)
0 swift 0x0000000112cc94ea PrintStackTraceSignalHandler(void*) + 42
1 swift 0x0000000112cc8cc0 SignalHandler(int) + 352
2 libsystem_platform.dylib 0x00007fff6757d5fd _sigtramp + 29
3 libsystem_platform.dylib 0x00007ffee12884e0 _sigtramp + 2043719424
4 swift 0x000000010f9f5f50 swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::ParameterList*) + 272
5 swift 0x000000010f9f90e7 (anonymous namespace)::Traversal::visitAbstractFunctionDecl(swift::AbstractFunctionDecl*) + 487
6 swift 0x000000010f9f5e03 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 275
7 swift 0x000000010f3ed538 swift::SILProfiler::create(swift::SILModule&, swift::ForDefinition_t, swift::ASTNode, swift::SILDeclRef) + 2824
8 swift 0x000000010ee306ca swift::Lowering::SILGenModule::emitConstructor(swift::ConstructorDecl*) + 778
9 swift 0x000000010ef2a3b1 swift::ASTVisitor<(anonymous namespace)::SILGenType, void, void, void, void, void, void>::visit(swift::Decl*) + 145
10 swift 0x000000010ef2853b (anonymous namespace)::SILGenType::emitType() + 1163
11 swift 0x000000010ee3a5e2 swift::ASTVisitor<swift::Lowering::SILGenModule, void, void, void, void, void, void>::visit(swift::Decl*) + 82
12 swift 0x000000010ee397ac swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*) + 1356
13 swift 0x000000010ee3b82e swift::SILModule::constructSIL(swift::ModuleDecl*, swift::Lowering::TypeConverter&, swift::SILOptions&, swift::FileUnit*) + 1438
14 swift 0x000000010ea1b657 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 48055
15 swift 0x000000010e9934d3 main + 1283
16 libdyld.dylib 0x00007fff67384cc9 start + 1
[1] 59651 segmentation fault swift -frontend -c -primary-file ~/Desktop/crash.swift -target -sdk
With Xcode 11.3.1 selected, this slightly modified command does not:
swift -frontend -c -primary-file ~/Desktop/crash.swift -target x86_64-apple-ios12.0-simulator -sdk /Applications/Xcode_11.3.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk -profile-generate -profile-coverage-mapping
# [nothing printed after that, because there is no error or crash]
I noticed that this slightly modified version of the code, with a global function instead of an initializer, crashes both Xcode 11.4 and 11.3.1's toolchains, but I'm not sure if it's related or separate, so please let me know if I should file a separate bug:
Confirmed! It took me a minute to learn about the magic export TOOLCHAINS=swift to get my Terminal to pick up the custom toolchain, but once it had, it compiled without incident ��♂️
Environment
Xcode 11.3.1 (11C505) and Xcode 11.4 (11E146) on macOS 10.15.4 (19E266)
Additional Detail from JIRA
md5: 2ca56ae0633ba678a44236ae721150b2
Issue Description:
I've isolated this down as much as I can. I don't understand what all the Terminal command parameters do; I found them by grabbing the swift invocation from an Xcode project and removing as many parameters as I could while still reproducing the issue.
crash.swift:
With Xcode 11.4 selected, this segfaults:
With Xcode 11.3.1 selected, this slightly modified command does not:
I noticed that this slightly modified version of the code, with a global function instead of an initializer, crashes both Xcode 11.4 and 11.3.1's toolchains, but I'm not sure if it's related or separate, so please let me know if I should file a separate bug:
Xcode 11.4:
Xcode 11.3.1:
I haven't tested on the nightly toolchain.
The text was updated successfully, but these errors were encountered: