#8 added more debug output that helped to find the SegFault. The scenario: The on_close handler of the websocket cancels and stops the TCP socket (that usually causes the operation_aborted error in the handler) and afterwards deletes the corresponding Connection object. Nearly at the same time the TCP receive finished (before the async cancel call had any effect) and the handler is queued to be executed in near future. Now, after the Connection is destroyed the handler is executed. Since the TCP receive finished before the cancel call there is no error (operation_aborted) visible in the handler that would normally causes it to stop and it tries do the normal work .. on an already deleted object.