I'm a bit new here with swift error. My app experiencing specialied error, that i can't figure it out for quite sometimes.
Can anyone suggest on how to tackle this problem and what usually causes Specialized error ?
Here is there error report that i got.
0 libsystem_kernel.dylib 0x183cf12ec __pthread_kill + 8
1 libsystem_pthread.dylib 0x183e966a8 pthread_kill$VARIANT$armv81 + 360
2 libsystem_c.dylib 0x183c5fd0c abort + 140
3 libsystem_malloc.dylib 0x183d29838 szone_size + 634
4 libswiftCore.dylib 0x104078f10 _swift_release_dealloc + 28
5 AppMy 0x1021b45b8 specialized _VariantDictionaryBuffer.ensureUniqueNativeBuffer(Int) -> (reallocated : Bool, capacityChanged : Bool) (WatchListStockViewController.swift)
6 AppMy 0x1021b5a14 specialized specialized _VariantDictionaryBuffer.nativeUpdateValue(B, forKey : A) -> B? (WatchListStockViewController.swift)
7 AppMy 0x1021b612c specialized WatchListStockViewController.updateCompanies(String, widget : JSON) -> () (WatchListStockViewController.swift:1065)
8 AppMy 0x1021b67dc specialized WatchListStockViewController.fireSocketMessage(JSON) -> () (WatchListStockViewController.swift:1039)
9 AppMy 0x1021b96d8 partial apply for WatchListStockViewController.(subscribeWebSocket() -> ()).(closure #1) (WatchListStockViewController.swift:200)
10 AppMy 0x102538318 JSON (StreamHomeViewController.swift)
11 AppMy 0x1022abb70 specialized SockJSManager.handleChannel(JSON) -> () + 4369972080
12 AppMy 0x1022a8514 SockJSManager.(handleMessage(response : String) -> ()).(closure #1) (SockJSManager.swift:399)
13 AppMy 0x10250c28c _T0Ieg_IeyB_TR (BaseViewController.swift)
14 libdispatch.dylib 0x183b5cb24 _dispatch_call_block_and_release + 24
15 libdispatch.dylib 0x183b5cae4 _dispatch_client_callout + 16
16 libdispatch.dylib 0x183b98528 _dispatch_queue_override_invoke$VARIANT$armv81 + 700
17 libdispatch.dylib 0x183b9e3a4 _dispatch_root_queue_drain + 592
18 libdispatch.dylib 0x183b9e0f0 _dispatch_worker_thread3 + 112
19 libsystem_pthread.dylib 0x183e8ffac _pthread_wqthread + 1176
20 libsystem_pthread.dylib 0x183e8fb08 start_wqthread + 4
First, to help debugging exceptions in general, this Xcode Help page describes how to create exception breakpoints. It would be helpful to know what kind of exception was actually thrown here - maybe an
EXP_BAD_ACCESS
?Now to your specific crash.
The word "specialized" doesn't really characterize the problem here, it only indicates that the called method signatures were derived from generic ones.
Further, to really know what's going on, one would need to see the source code of
WatchListStockViewController.updateCompanies(String, widget : JSON)
.What I can tell from your stack trace is that your app crashes when trying to update a value in a
_VariantDictionaryBuffer
, which is used as the underlying data structure forDictionary
. Given that dictionaries in Swift aren't thread safe, and your code is running in a dispatch queue, seemingly handling (parallel?) WebSockets, the error might be caused by concurrent read/write access to some dictionary that contains "company" information. CouldWatchListStockViewController.updateCompanies
be called from different threads at the same time?Again, without knowing the code it is really hard to tell what exactly is going wrong, maybe you can attach a snippet to your question ...