socket.io-client-swift icon indicating copy to clipboard operation
socket.io-client-swift copied to clipboard

Pointer being freed was not allocated | Random Crash

Open InfiniteDreamz opened this issue 5 years ago • 1 comments

A very infrequent crash is coming in my project with the following exception:

malloc: *** error for object 0x7f9c6391b800: pointer being freed was not allocated
(34527,0x700001505000) malloc: *** set a breakpoint in malloc_error_break to debug

Following is my code snippet to emit an event:

private func emitWithACK(withTimeoutAfter seconds: Double, event: String, params : JSONDictionary?, array:[Any]?, ackHandler: (([Any]) -> Void)? = nil) {
        
        var ack : OnAckCallback? = nil
        
        if let tempParams = params {
            ack = self.socket?.emitWithAck(event, tempParams)
        } else if let tempArray = array{
            ack = self.socket?.emitWithAck(event, tempArray)
        } else {
            ack = self.socket?.emitWithAck(event)
        }
        
        ack?.timingOut(after: seconds, callback: { (data) in
            ackHandler?(data)
        })
    }

Screenshot 2020-05-30 at 4 25 15 PM Screenshot 2020-05-30 at 4 25 40 PM

InfiniteDreamz avatar May 30 '20 10:05 InfiniteDreamz

@banjun @rauchg @bazza @mdawaffe Hey guyz, Can anyone help. a lot of users are affected because of this crash.

InfiniteDreamz avatar Jun 01 '20 08:06 InfiniteDreamz