Open light-cloud opened 11 months ago
It's kind of strange that WebSocket.reconnect()
is calling from com.walletconnect.sdk.network.monitor
thread. Looks like concurrency issue. What crash message that you're receiving?
I can see just this message in the report.
Crashed: com.walletconnect.sdk.network.monitor
EXC_BREAKPOINT 0x000000019cd4ae44
Also this one:
Crashed: com.walletconnect.sdk.network.monitor
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000030
Crashed: com.walletconnect.sdk.network.monitor
0 CoreFoundation 0x3810 __CFBasicHashReplaceValue + 452
1 CoreFoundation 0x2e80 CFDictionarySetValue + 208
2 CFNetwork 0x208610 _CFHTTPServerResponseEnqueue + 24304
3 CFNetwork 0xdf408 _CFStreamErrorFromCFError + 9644
4 CFNetwork 0x2940 CFURLRequestSetHTTPHeaderFieldValue + 136
5 Foundation 0x12e184 specialized URLRequest._applyMutation<A>(_:) + 336
6 TestApp 0xea2250 WebSocket.createHTTPRequest() + 594 (WebSocket.swift:594)
7 WalletConnectSwiftV2 0x34bbc closure #1 in AutomaticSocketConnectionHandler.setUpNetworkMonitoring() + 68 (AutomaticSocketConnectionHandler.swift:68)
8 Combine 0x59b8 Subscribers.Sink.receive(_:) + 96
9 Combine 0x5948 protocol witness for Subscriber.receive(_:) in conformance Subscribers.Sink<A, B> + 24
10 Combine 0x29808 Publishers.Autoconnect.Inner.receive(_:) + 52
11 Combine 0x29764 Publishers.Multicast.Inner.receive(_:) + 236
12 Combine 0x2966c protocol witness for Subscriber.receive(_:) in conformance Publishers.Multicast<A, B>.Inner<A1> + 24
13 Combine 0x22ec8 PassthroughSubject.Conduit.offer(_:) + 708
14 Combine 0x22bf4 partial apply for closure #1 in PassthroughSubject.send(_:) + 68
15 Combine 0x22b90 ConduitList.forEach(_:) + 272
16 Combine 0x22a2c PassthroughSubject.send(_:) + 264
17 Combine 0x1a1c8 SubjectSubscriber.receive(_:) + 188
18 Combine 0x1a0fc protocol witness for Subscriber.receive(_:) in conformance SubjectSubscriber<A> + 24
19 Combine 0x24de0 CurrentValueSubject.Conduit.offer(_:) + 784
20 Combine 0x24ac0 partial apply for closure #1 in CurrentValueSubject.send(_:) + 68
21 Combine 0x22b90 ConduitList.forEach(_:) + 272
22 Combine 0x3981c CurrentValueSubject.send(_:) + 372
23 WalletConnectSwiftV2 0x830e8 closure #1 in NetworkMonitor.init() + 28 (NetworkMonitoring.swift:28)
24 Network 0x16fd48 partial apply for closure #1 in NWPathMonitor.startLocked(lockedState:) + 92
25 Network 0x166e28 thunk for @escaping @callee_guaranteed @Sendable () -> () + 36
26 libdispatch.dylib 0x26a8 _dispatch_call_block_and_release + 32
27 libdispatch.dylib 0x4300 _dispatch_client_callout + 20
28 libdispatch.dylib 0xb894 _dispatch_lane_serial_drain + 748
29 libdispatch.dylib 0xc3c4 _dispatch_lane_invoke + 380
30 libdispatch.dylib 0x17004 _dispatch_root_queue_drain_deferred_wlh + 288
31 libdispatch.dylib 0x16878 _dispatch_workloop_worker_thread + 404
32 libsystem_pthread.dylib 0x1964 _pthread_wqthread + 288
33 libsystem_pthread.dylib 0x1a04 start_wqthread + 8
@flypaper0 Just an assumption, but is it possible that two queues try to access the socket at the same time, causing the crash? If this assumption is valid, and I am not mistaken, is it possible to add some synchronization mechanism to protect against this in the WalletConnect code?
In AutomaticSocketConnectionHandler
, in the debugger, I can see that com.walletconnect.sdk.network.monitor
attempts to access the socket and reconnect when the internet appears/disappears, and another dispatcher queue com.apple.root.user-initiated-qos.cooperative
when the socket disconnects.
Please let me know if you can just put everything into my coinbase wallet at veicles70nova.cb.id
We received the same crash report from firebase.
Crashed: com.walletconnect.sdk.network.monitor
0 CoreFoundation 0xd454 __CFBasicHashDeallocate + 24
1 CoreFoundation 0xc120 _CFRelease + 292
2 CFNetwork 0x2091fc _CFHTTPServerResponseEnqueue + 23744
3 CoreFoundation 0xc120 _CFRelease + 292
4 CFNetwork 0xddbe0 _CFStreamErrorFromCFError + 2004
5 CFNetwork 0xdf9a8 _CFStreamErrorFromCFError + 9628
6 CFNetwork 0x211c CFURLRequestSetHTTPHeaderFieldValue + 136
7 Foundation 0x12be58 specialized URLRequest.applyMutation(:) + 336
8 Starscream 0x11b54 $s10Starscream9WebSocketC17createHTTPRequest33E91840E7069A0D2D302D042308E9D928LLyyF + 820
9 hebaoapp 0x1866ab4 closure #1 in AutomaticSocketConnectionHandler.setUpNetworkMonitoring() + 68 (AutomaticSocketConnectionHandler.swift:68)
10 Combine 0x59b8 Subscribers.Sink.receive(:) + 96
11 Combine 0x5948 protocol witness for Subscriber.receive(:) in conformance Subscribers.Sink<A, B> + 24
12 Combine 0x29808 Publishers.Autoconnect.Inner.receive(:) + 52
13 Combine 0x29764 Publishers.Multicast.Inner.receive(:) + 236
14 Combine 0x2966c protocol witness for Subscriber.receive(:) in conformance Publishers.Multicast<A, B>.Inner
@flypaper0 Could you kindly provide any updates on the status of the issue? Thank you.
@flypaper0 / @llbartekll Got the same issue report in sentry. Had it happen in 2 versions now. Latest is 1.10.0
@flypaper0 / @llbartekll Could you kindly provide any updates on the status of the issue? Thank you.
@light-cloud i think the issue should be resolved, do you still experience a crash?
@llbartekll Thank you for your feedback! We will update our library to the latest version 1.19.4 to verify this issue.
Hi team, we’ve been receiving some crashes from
com.walletconnect.sdk.network.monitor
. Was not able to reproduce these crashes. What could cause this?Crash:
In file WebSocket.swift:591 I see this:
request.setValue(headerWSConnectionValue, forHTTPHeaderField: headerWSConnectionName)
Environment:
OS/Version: 17.1.2 WalletConnect Version 1.9.1 Starscream Version 3.1.1 Xcode version 15.0.1
From Crashlytics: