Swift 1.2b3 - Compiler crash attempting to call ReactiveCocoa.observe
| Originator: | npankey | ||
| Number: | rdar://20183739 | Date Originated: | 3-16-15 |
| Status: | Open | Resolved: | |
| Product: | Xcode | Product Version: | Xcode 6.3 Beta 3 (6D543q) |
| Classification: | Crash | Reproducible: | Always |
Summary:
The following code (dependent on https://github.com/ReactiveCocoa/ReactiveCocoa) crashes the compiler
import Cocoa
import ReactiveCocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var window: NSWindow!
func applicationDidFinishLaunching(aNotification: NSNotification) {
let (signal, sink) = Signal<String, NoError>.pipe()
signal |> observe(next: { value in println("\(value)") })
sendNext(sink, "Hello, world");
}
}
With the following notes
1. While emitting SIL for 'applicationDidFinishLaunching' at /Users/neilpa/code/RAC1829/RAC1829/AppDelegate.swift:9:5
2. While emitting reabstraction thunk in SIL function @_TTRXFo_iSS_dT__XFo_oSS_dT__
Steps to Reproduce:
1. Clone the repo at https://github.com/neilpa/RAC1829 which contains the required dependencies
2. Open the included RAC1829.xcodeproj and attempt the build the project to observe the crash.
Expected Results:
The above code compiles successfully and prints "Hello, world" when run
Actual Results:
The above code crashes the compiler with the following truncated stack
0 swift 0x0000000107301388 llvm::sys::PrintStackTrace(__sFILE*) + 40
1 swift 0x0000000107301864 SignalHandler(int) + 452
2 libsystem_platform.dylib 0x00007fff8e94bf1a _sigtramp + 26
3 libsystem_platform.dylib 0x000000010941b000 _sigtramp + 2058154240
4 swift 0x0000000106d9e057 createThunk(swift::Lowering::SILGenFunction&, swift::SILLocation, TranslationKind, swift::Lowering::ManagedValue, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>, swift::Lowering::TypeLowering const&) + 1159
5 swift 0x0000000106d9e901 (anonymous namespace)::OrigToSubst::transformFunction(swift::Lowering::ManagedValue, swift::Lowering::AbstractionPattern, swift::CanTypeWrapper<swift::AnyFunctionType>) + 177
6 swift 0x0000000106d99d7e (anonymous namespace)::Transform::transform(swift::Lowering::ManagedValue, swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::SGFContext) + 62
7 swift 0x0000000106d9a5c8 swift::Lowering::SILGenFunction::emitOrigToSubstValue(swift::SILLocation, swift::Lowering::ManagedValue, swift::Lowering::AbstractionPattern, swift::CanType, swift::Lowering::SGFContext) + 56
8 swift 0x0000000106d40a5f swift::Lowering::SILGenFunction::emitApply(swift::SILLocation, swift::Lowering::ManagedValue, llvm::ArrayRef<swift::Substitution>, llvm::ArrayRef<swift::Lowering::ManagedValue>, swift::CanTypeWrapper<swift::SILFunctionType>, swift::Lowering::AbstractionPattern, swift::CanType, bool, llvm::Optional<swift::AbstractCC>, swift::Lowering::SGFContext) + 2079
9 swift 0x0000000106d65668 swift::Lowering::SILGenFunction::emitApplyOfDefaultArgGenerator(swift::SILLocation, swift::ConcreteDeclRef, unsigned int, swift::CanType, swift::Lowering::SGFContext) + 456
10 swift 0x0000000106d4c8d4 (anonymous namespace)::ArgEmitter::emitShuffle(swift::Expr*, swift::Expr*, llvm::ArrayRef<swift::TupleTypeElt>, swift::ConcreteDeclRef, llvm::ArrayRef<swift::Expr*>, llvm::ArrayRef<int>, swift::Type, swift::Lowering::AbstractionPattern) + 4884
11 swift 0x0000000106d4b3b3 (anonymous namespace)::ArgEmitter::emitExpanded(swift::Lowering::ArgumentSource&&, swift::Lowering::AbstractionPattern) + 2387
12 swift 0x0000000106d49d30 (anonymous namespace)::CallSite::emit(swift::Lowering::SILGenFunction&, swift::Lowering::AbstractionPattern, (anonymous namespace)::ParamLowering&, llvm::SmallVectorImpl<swift::Lowering::ManagedValue>&, llvm::SmallVectorImpl<std::__1::pair<swift::Lowering::LValue, swift::SILLocation> >&) && + 176
13 swift 0x0000000106d41886 (anonymous namespace)::CallEmission::apply(swift::Lowering::SGFContext) + 1078
...
Version:
Xcode 6.3 Beta 3 (6D543q)
Notes:
Configuration:
Xcode 6.3 Beta 3 on OS X 10.10
Attachments:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!