Getting random reactive swift crash

I am getting below crash in reactive swift library. Will really appreciate any help in resolving it.

Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_PROTECTION_FAILURE at 0x000000016b33bfe0 Exception Codes: 0x0000000000000002, 0x000000016b33bfe0 VM Region Info: 0x16b33bfe0 is in 0x16b338000-0x16b33c000; bytes after start: 16352 bytes before end: 31 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL MALLOC_SMALL 15b800000-15c000000 [ 8192K] rw-/rwx SM=PRV
GAP OF 0xf338000 BYTES ---> STACK GUARD 16b338000-16b33c000 [ 16K] ---/rwx SM=NUL ... for thread 0 Stack 16b33c000-16b438000 [ 1008K] rw-/rwx SM=SHM thread 0 Termination Reason: SIGNAL 11 Segmentation fault: 11 Terminating Process: exc handler [1677]

Triggered by Thread: 0

Thread 0 name: Thread 0 Crashed: 0 libswiftCore.dylib 0x000000019371c5a8 getCache(swift::TargetTypeContextDescriptor<swift::InProcess> const&) + 8 (Metadata.cpp:479) 1 libswiftCore.dylib 0x000000019371d108 swift_getGenericMetadata(swift::MetadataRequest, void const* const*, swift::TargetTypeContextDescriptor<swift::InProcess> const*) + 56 (Metadata.cpp:937) 2 ReactiveSwift 0x0000000107cdef74 __swift_instantiateGenericMetadata + 28 (<compiler-generated>:0) 3 ReactiveSwift 0x0000000107cfe3b8 specialized Signal.Core.send(:) + 540 (Signal.swift:115) 4 ReactiveSwift 0x0000000107d2b408 Signal.Observer.send(:) + 20 (Signal.Observer.swift:111) 5 ReactiveSwift 0x0000000107cf7390 closure #3 in closure #1 in closure #1 in Signal<>.observeSwitchToLatest(::) + 188 (Flatten.swift:677) 6 ReactiveSwift 0x0000000107d2b408 Signal.Observer.send(:) + 20 (Signal.Observer.swift:111) 7 ReactiveSwift 0x0000000107d195f8 Signal.Core.tryToCommitTermination() + 604 (Signal.swift:231) 8 ReactiveSwift 0x0000000107cfe3b8 specialized Signal.Core.send(:) + 540 (Signal.swift:115) 9 ReactiveSwift 0x0000000107d2b408 Signal.Observer.send(:) + 20 (Signal.Observer.swift:111) 10 ReactiveSwift 0x0000000107cf7390 closure #3 in closure #1 in closure #1 in Signal<>.observeSwitchToLatest(::) + 188 (Flatten.swift:677) 11 ReactiveSwift 0x0000000107d2b408 Signal.Observer.send(:) + 20 (Signal.Observer.swift:111) 12 ReactiveSwift 0x0000000107d195f8 Signal.Core.tryToCommitTermination() + 604 (Signal.swift:231) 13 ReactiveSwift 0x0000000107cfe3b8 specialized Signal.Core.send(:) + 540 (Signal.swift:115) 14 ReactiveSwift 0x0000000107d2b408 Signal.Observer.send(:) + 20 (Signal.Observer.swift:111) 15 ReactiveSwift 0x0000000107cf7390 closure #3 in closure #1 in closure #1 in Signal<>.observeSwitchToLatest(:_:) + 188 (Flatten.swift:677)

Here is Stack trace for the crash.

Consider this:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_PROTECTION_FAILURE at 0x000000016b33bfe0
Exception Codes: 0x0000000000000002, 0x000000016b33bfe0
…
      GAP OF 0xf338000 BYTES
--->  STACK GUARD              16b338000-16b33c000 [   16K] ---/rwx SM=NUL…
      Stack                    16b33c000-16b438000 [ 1008K] rw-/rwx SM=SHM…

It suggests that a thread has overflowed its stack. Looking at the backtrace, I see this:

Thread 0 name:
Thread 0 Crashed:
0   libswiftCore.dylib … getCache(swift::TargetTypeContextDescriptor const&) + 8 (Metadata.cpp:479)
1   libswiftCore.dylib … _swift_getGenericMetadata(swift::MetadataRequest, void const* const*, swift::TargetTyp…
2   ReactiveSwift      … __swift_instantiateGenericMetadata + 28 (:0)
3   ReactiveSwift      … specialized Signal.Core.send(_:) + 540 (Signal.swift:115)
4   ReactiveSwift      … Signal.Observer.send(_:) + 20 (Signal.Observer.swift:111)
5   ReactiveSwift      … closure #3 in closure #1 in closure #1 in Signal<>.observeSwitchToLatest(_:_:) + 188 (…
6   ReactiveSwift      … Signal.Observer.send(_:) + 20 (Signal.Observer.swift:111)
7   ReactiveSwift      … Signal.Core.tryToCommitTermination() + 604 (Signal.swift:231)
8   ReactiveSwift      … specialized Signal.Core.send(_:) + 540 (Signal.swift:115)
9   ReactiveSwift      … Signal.Observer.send(_:) + 20 (Signal.Observer.swift:111)
10  ReactiveSwift      … closure #3 in closure #1 in closure #1 in Signal<>.observeSwitchToLatest(_:_:) + 188 (…
11  ReactiveSwift      … Signal.Observer.send(_:) + 20 (Signal.Observer.swift:111)
12  ReactiveSwift      … Signal.Core.tryToCommitTermination() + 604 (Signal.swift:231)

Frames 12 through 7 make up a repeating pattern, suggesting that you’re crashing due to an infinite notification loop. All those frames are in your third-party runtime, so I recommend that you pursue this via the support channel for that runtime.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Getting random reactive swift crash
 
 
Q