
* thread #2, queue = 'CocoaMQTTWebSocket', stop reason = Fatal error: invalid Collection: less than 'count' elements in collection
frame #0: 0x00000001894a8eac libswiftCore.dylib`_swift_runtime_on_report
frame #1: 0x0000000189521100 libswiftCore.dylib`_swift_stdlib_reportFatalErrorInFile + 192
frame #2: 0x0000000189160668 libswiftCore.dylib`closure #1 (Swift.UnsafeBufferPointer
) -> () in closure #1 (Swift.UnsafeBufferPointer) -> () in closure #1 (Swift.UnsafeBufferPointer) -> () in Swift._assertionFailure(_: Swift.StaticString, _: Swift.StaticString, file: Swift.StaticString, line: Swift.UInt, flags: Swift.UInt32) -> Swift.Never + 384
frame #3: 0x000000018915fce0 libswiftCore.dylib`Swift._assertionFailure(_: Swift.StaticString, _: Swift.StaticString, file: Swift.StaticString, line: Swift.UInt, flags: Swift.UInt32) -> Swift.Never + 380
frame #4: 0x00000001891499c4 libswiftCore.dylib`Swift._copyCollectionToContiguousArray(τ_0_0) -> Swift.ContiguousArray + 1084
frame #5: 0x00000001892d7168 libswiftCore.dylib`merged protocol witness for Swift.Sequence._copyToContiguousArray() -> Swift.ContiguousArray in conformance Swift._ArrayBuffer : Swift.Sequence in Swift + 48
frame #6: 0x00000001892f9314 libswiftCore.dylib`Swift.Sequence.sorted(by: (τ_0_0.Element, τ_0_0.Element) throws -> Swift.Bool) throws -> Swift.Array + 180
* frame #7: 0x00000001029e5ad4 SmartElectricityApp`CocoaMQTTWebSocket.checkScheduledWrites(self=0x0000000281079080) at CocoaMQTTWebSocket.swift:237:52
frame #8: 0x00000001029e1d58 SmartElectricityApp`closure #1 in CocoaMQTTWebSocket.write(tag=0, timeout=5, self=0x0000000281079080, data=4 bytes) at CocoaMQTTWebSocket.swift:128:18
frame #9: 0x000000010260c5e4 SmartElectricityApp`thunk for @escaping @callee_guaranteed () -> () at :0
frame #10: 0x000000010444c064 libdispatch.dylib`_dispatch_call_block_and_release + 32
frame #11: 0x000000010444dd90 libdispatch.dylib`_dispatch_client_callout + 20
frame #12: 0x0000000104455ea0 libdispatch.dylib`_dispatch_lane_serial_drain + 788
frame #13: 0x0000000104456cc4 libdispatch.dylib`_dispatch_lane_invoke + 444
frame #14: 0x0000000104463a00 libdispatch.dylib`_dispatch_workloop_worker_thread + 1600
frame #15: 0x00000001d0ff67a4 libsystem_pthread.dylib`_pthread_wqthread + 276
hello. We need some steps to reproduce the crash
Hi, I got the crash maybe relating to this issue, this log I got
`Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x8000000000000010 -> 0x0000000000000010 (possible pointer authentication failure)
VM Region Info: 0x10 is not in any region. Bytes before following region: 4366483440
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
--->
__TEXT 104434000-104440000 [ 48K] r-x/r-x SM=COW ...rchantSandbox
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [647]
Triggered by Thread: 9
Thread 9 name:
Thread 9 Crashed:
0 CocoaMQTT 0x0000000104567ed4 $sSh5countSivg9CocoaMQTT0B13MQTTWebSocketC9WriteItem33_E7331A8B74B4106D4653FB1F426555ECLLV_Tg5 + 0 (:0)
1 CocoaMQTT 0x0000000104567ed4 $sShyxGSlsSl5countSivgTW9CocoaMQTT0B13MQTTWebSocketC9WriteItem33_E7331A8B74B4106D4653FB1F426555ECLLV_Tg5 + 0 (:0)
2 CocoaMQTT 0x0000000104567ed4 $ss32_copyCollectionToContiguousArrayys0dE0Vy7ElementQzGxSlRzlFShy9CocoaMQTT0G13MQTTWebSocketC9WriteItem33_E7331A8B74B4106D4653FB1F426555ECLLVG_Tg5 + 0 (:0)
3 CocoaMQTT 0x0000000104567ed4 $sSlsE22_copyToContiguousArrays0cD0Vy7ElementQzGyFShy9CocoaMQTT0F13MQTTWebSocketC9WriteItem33_E7331A8B74B4106D4653FB1F426555ECLLVG_Tg5 + 0 (:0)
4 CocoaMQTT 0x0000000104567ed4 $sShyxGSTsST22_copyToContiguousArrays0cD0Vy7ElementQzGyFTW9CocoaMQTT0F13MQTTWebSocketC9WriteItem33_E7331A8B74B4106D4653FB1F426555ECLLV_Tg5 + 0 (:0)
5 CocoaMQTT 0x0000000104567ed4 specialized ContiguousArray.init<A>(:) + 20
6 CocoaMQTT 0x0000000104560338 $ss15ContiguousArrayVyAByxGqd__c7ElementQyd__RszSTRd__lufC9CocoaMQTT0D13MQTTWebSocketC9WriteItem33_E7331A8B74B4106D4653FB1F426555ECLLV_ShyAKGTg5 + 8 (:0)
7 CocoaMQTT 0x0000000104560338 $sSTsE6sorted2bySay7ElementQzGSbAD_ADtKXE_tKFShy9CocoaMQTT0D13MQTTWebSocketC9WriteItem33_E7331A8B74B4106D4653FB1F426555ECLLVG_Tg5 + 8 (:0)
8 CocoaMQTT 0x0000000104560338 CocoaMQTTWebSocket.checkScheduledWrites() + 264
9 CocoaMQTT 0x000000010455eba0 closure #1 in CocoaMQTTWebSocket.write(:withTimeout:tag:) + 364 (CocoaMQTTWebSocket.swift:136)
10 CocoaMQTT 0x00000001045329d4 thunk for @escaping @callee_guaranteed () -> () + 28 (:0)
11 libdispatch.dylib 0x00000001a54dc24c _dispatch_call_block_and_release + 32 (init.c:1454)
12 libdispatch.dylib 0x00000001a54dddb0 _dispatch_client_callout + 20 (object.m:559)
13 libdispatch.dylib 0x00000001a54e510c _dispatch_lane_serial_drain + 580 (inline_internal.h:2548)
14 libdispatch.dylib 0x00000001a54e5c5c _dispatch_lane_invoke + 408 (queue.c:3862)
15 libdispatch.dylib 0x00000001a54efd78 _dispatch_workloop_worker_thread + 708 (queue.c:6601)
16 libsystem_pthread.dylib 0x00000001f1399814 _pthread_wqthread + 276 (pthread.c:2211)
17 libsystem_pthread.dylib 0x00000001f13a076c start_wqthread + 8 (:-1)`
It happens randomly in version 2.0.5, I can't replicate it.
Does anyone have any solutions?