daltoniam / Starscream

Websockets in swift for iOS and OSX
Apache License 2.0
8.36k stars 1.21k forks source link

Facing crash for 1% users in TCPTransport.write function #1032

Open naren1449 opened 5 months ago

naren1449 commented 5 months ago

PhysicsWallah app is an Ed-tech platform providing live lectures to students, We use features like chat and poll along with the live classes. Facing issue in poll events and chat meta events as for that we are using starscream. Crash is creating a bad impact on the product. Our dau for iOS is a healthy 40-50k with student engagement of around 1-1.5 hours.

Describe the bug

This started happening after we updated to latest 4.0.8 in our latest release.

Steps to Reproduce

Behavior is random though as it is coming for 1% of users till now. we are not sending any data, we use this only for getting data from server to show Polls and chat meta events.

Expected behavior

Expected behavior should be no crash generated.

Environment:

Additional context

Crash details ----- All data collected from Firebase crashlytics

TCPTransport.write(data:completion:) EXC_BAD_ACCESS (KERN_INVALID_ADDRESS)

Crashed: com.vluxe.starscream.writequeue 0 libswiftCore.dylib 0x3ab354 _swift_release_dealloc + 32 1 libswiftCore.dylib 0x3ac488 bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1> >::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 136 2 Starscream 0x18c0c TCPTransport.write(data:completion:) + 100 (TCPTransport.swift:100) 3 Starscream 0x22a2c closure #1 in WSEngine.write(data:opcode:completion:) + 520 4 Starscream 0xc138 thunk for @escaping @callee_guaranteed @Sendable () -> () + 28 (:28) 5 libdispatch.dylib 0x213c _dispatch_call_block_and_release + 32 6 libdispatch.dylib 0x3dd4 _dispatch_client_callout + 20 7 libdispatch.dylib 0xb400 _dispatch_lane_serial_drain + 748 8 libdispatch.dylib 0xbf30 _dispatch_lane_invoke + 380 9 libdispatch.dylib 0x16cb4 _dispatch_root_queue_drain_deferred_wlh + 288 10 libdispatch.dylib 0x16528 _dispatch_workloop_worker_thread + 404 11 libsystem_pthread.dylib 0x1f20 _pthread_wqthread + 288 12 libsystem_pthread.dylib 0x1fc0 start_wqthread + 8

CodeKunal commented 5 months ago

Facing similar crash here https://github.com/daltoniam/Starscream/issues/1033

DeepBhupatkar commented 3 months ago

Hello, did you manage to resolve the issue? I am encountering the same difficulty. Do you have any suggestions for a solution?