mixpanel-swift
mixpanel-swift copied to clipboard
Lots of crashes on `FlushRequest.sendRequest(_:type:useIP:completion:)` with 4.0.4
Integration Method: SPM Xcode Version: 14.1.0 Library Version: 4.0.4 Platform: iOS Language: Swift Description:
We got lots of crashes using the 4.0.4 release on FlushRequest.sendRequest(_:type:useIP:completion:)
:

The raw stack trace:
@malcommac Are you able to reproduce this issue? If so, can you provide the steps? Were you using older versions without this problem? If so, what version were you upgrading from? Any additional info you can provide would be helpful.
Before that, we used 3.5.1 without the issue. Unfortunately, I'm not able to reproduce this issue, but it seems to be happening at the early stage of the app launch. Maybe it could be related to some flush events of the local events not sent in the previous session?
I wonder if anyone read these issues.

Anyway it still the most relevant crash issue in our app right after the startup (100% of crash events for this issue happened in the first 5 seconds of a user's session).
Crashed: com.mixpanel.caf0d89293f630a8e27cdb2914e3ef57.network)
SIGSEGV 0x0000000000000000
Crashed: com.mixpanel.caf0d89293f630a8e27cdb2914e3ef57.network)
0 Indomio 0xa90168 FlushRequest.sendRequest(_:type:useIP:completion:) + 4383342952
1 Indomio 0xa8f1a0 Flush.flushQueueInBatches(_:type:) + 4383338912
2 Indomio 0xaace4c closure #1 in closure #1 in MixpanelInstance.flush(completion:) + 4383460940
3 Indomio 0x2f70c thunk for @escaping @callee_guaranteed () -> () + 4372461324
4 libdispatch.dylib 0x2460 _dispatch_call_block_and_release + 32
5 libdispatch.dylib 0x3f88 _dispatch_client_callout + 20
6 libdispatch.dylib 0xb640 _dispatch_lane_serial_drain + 672
7 libdispatch.dylib 0xc18c _dispatch_lane_invoke + 384
8 libdispatch.dylib 0x16e10 _dispatch_workloop_worker_thread + 652
9 libsystem_pthread.dylib 0xdf8 _pthread_wqthread + 288
10 libsystem_pthread.dylib 0xb98 start_wqthread + 8
@malcommac Apologies for the lack of progress here but I was never able to reproduce this crash and this is the only report we have. If you get additional information, particularly anything that might help reproduce the issue please add it here.
Hello all. This bug is happening to us also, with exactly the same stack trace. On our case, all crashes happen within the first second of execution. We have tried to debug it, but is difficult to reproduce.
Hello, We are also having this crash since we integrated Mixpanel. It is currently the top crash in our app. We also noticed it happens at the first second of opening the app.
Hello @jaredmixpanel. Have Mixpanel plans for checking this? Because it is the first cause of crashes in our app, and as you see we are not the only ones affected. Thanks!
+1
happens in 4.1.0
Crashed: com.mixpanel.98b4601e9379667d3d2e678444373306.network)
0 <redacted> 0xa493d0 FlushRequest.sendRequest(_:type:useIP:completion:) + 30 (Network.swift:30)
1 <redacted> 0xa48408 Flush.flushQueueInBatches(_:type:) + 109 (Flush.swift:109)
2 <redacted> 0xa66a38 closure #1 in closure #1 in MixpanelInstance.flush(performFullFlush:completion:) + 973 (MixpanelInstance.swift:973)
3 <redacted> 0xa5e434 thunk for @escaping @callee_guaranteed () -> () + 4317127732 (<compiler-generated>:4317127732)
4 libdispatch.dylib 0x2320 _dispatch_call_block_and_release + 32
5 libdispatch.dylib 0x3eac _dispatch_client_callout + 20
6 libdispatch.dylib 0xb534 _dispatch_lane_serial_drain + 668
7 libdispatch.dylib 0xc0d8 _dispatch_lane_invoke + 436
8 libdispatch.dylib 0x16cdc _dispatch_workloop_worker_thread + 648
9 libsystem_pthread.dylib 0xddc _pthread_wqthread + 288
10 libsystem_pthread.dylib 0xb7c start_wqthread + 8
@malcommac @yeraydavidrodriguez @pmgsPT @gfoldv Just released v4.1.4
with a possible fix for this issue. Once you've updated please report back and let us know the results.
I'll try and let u know asap, thx
Still an issue in the v4.1.4 Pretty much the same stacktrace
Crashed: com.mixpanel.98b4601e9379667d3d2e678444373306.network)
0 <redacted> 0xa75810 FlushRequest.sendRequest(_:type:useIP:) + 30 (Network.swift:30)
1 <redacted> 0xa74db8 Flush.flushQueueInBatches(_:type:) + 107 (Flush.swift:107)
2 <redacted> 0xa94ae8 closure #1 in closure #1 in MixpanelInstance.flush(performFullFlush:completion:) + 973 (MixpanelInstance.swift:973)
3 <redacted> 0xa8c428 thunk for @escaping @callee_guaranteed () -> () + 4388946984 (<compiler-generated>:4388946984)
4 libdispatch.dylib 0x26a8 _dispatch_call_block_and_release + 32
5 libdispatch.dylib 0x4300 _dispatch_client_callout + 20
6 libdispatch.dylib 0xb894 _dispatch_lane_serial_drain + 748
7 libdispatch.dylib 0xc3f8 _dispatch_lane_invoke + 432
8 libdispatch.dylib 0x17004 _dispatch_root_queue_drain_deferred_wlh + 288
9 libdispatch.dylib 0x16878 _dispatch_workloop_worker_thread + 404
10 libsystem_pthread.dylib 0x1964 _pthread_wqthread + 288
11 libsystem_pthread.dylib 0x1a04 start_wqthread + 8
Please note, that the crash happens in the Network.swift -> line 30
Additional info (if it helps). The following code is used to initialize the SDK.
let token = AppSettings.shared.mixpanelToken
let instanceName = AppSettings.shared.mixpanelInstanceName
Mixpanel.initialize(token: token, trackAutomaticEvents: false, instanceName: instanceName)
Mixpanel.mainInstance().serverURL = "https://api-eu.mixpanel.com"
Mixpanel.mainInstance().flushOnBackground = true
Mixpanel.mainInstance().loggingEnabled = false
Mixpanel.mainInstance().identify(distinctId: Mixpanel.mainInstance().distinctId)
The mixpanelToken and mixpanelInstanceName are two tokens. One in the US and the other in the EU as we were moving data between the countries according to EU law.
Same issue in 4.1.4
Hello, any update here? I updated the library and it the crash is still there...still the top crash in our app.
Hi, we also updated to latest mixpanel build at your company and this crash appears in top-5 crashes even in small roll-out. We stopped release with trying to understand how to fix it
Hey, same here. This is a top crash for us.
Same issue on version 4.1.4 and also top crash for us
Is it going to be fixed ever? We have 3-5 crashes everyday with it.
@jaredmixpanel @zihejia how can we assist you to find the cause of the crash?
hi @malcommac @gfoldv , the root cause of the crash was a race condition occurring when setting the server URL. We have addressed this issue in v4.2.6. I am closing this issue, but please feel free to reopen it if the problem persists.