Cuberite Forum
Sending packets to deallocated cClientHandle - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Sending packets to deallocated cClientHandle (/thread-399.html)



Sending packets to deallocated cClientHandle - FakeTruth - 03-17-2012

Server can send packets to a cClientHandle that no longer exists, a dangling pointer.

It happens in cChunk::Broadcast, but it crashes somewhere deeper in the stack.

[Image: Screenshot-2012-03-17_11.57.53.png]

Something to note is that the server was updating .pak files from version 2 to 3. A client disconnected somewhere in the middle of conversion (thought it has a different address than the dangling pointer), and the server crashes after conversion was done.

Simply put, cChunk had a dangling pointer in m_LoadedByClient


RE: Sending packets to deallocated cClientHandle - xoft - 03-17-2012

You could have captured a crashdump for later analysis. Without it there's not much I can do.


RE: Sending packets to deallocated cClientHandle - xoft - 03-18-2012

And how did the client disconnect? If it was already downloading terrain, then it shouldn't disconnect (we answer to keepalives) and the client has no GUI for disconnecting at that state, other than closing the client altogether.


RE: Sending packets to deallocated cClientHandle - FakeTruth - 03-18-2012

(03-18-2012, 12:36 AM)xoft Wrote: And how did the client disconnect? If it was already downloading terrain, then it shouldn't disconnect (we answer to keepalives) and the client has no GUI for disconnecting at that state, other than closing the client altogether.

When the player is already in the game, and moves to somewhere that hasn't been converted yet, the player can simply press escape and disconnect


RE: Sending packets to deallocated cClientHandle - xoft - 03-19-2012

Right, somehow I thought you were referring to the initial connection phase.

Well, anyway, I'm afraid you're on your own on this one, as I haven't seen such a failure happen yet.


RE: Sending packets to deallocated cClientHandle - FakeTruth - 03-19-2012

I tried to track down why this happened, but I can't find a reason Sad