Menu

#639 thread safety of playerc_client_writepacket

Release-3.1
closed-accepted
Player (393)
5
2013-11-11
2011-03-29
Jayen Ashar
No

We've got a player client with two threads: one for sending commands, and one for receiving data. The two threads use the same playerc_client_t and are in PULL mode. In pull mode, the player client sends a packet, so in our multi-threaded client, it occasionally collides with sending a command, causing the player server to receive an invalid packet and crash. I've attached a patch to fix this.

Discussion

  • Jayen Ashar

    Jayen Ashar - 2011-04-04

    In our multi-threaded client, we don't seem to be hitting the system's 8MB stack limit, but I am hitting it in clients like playerv. So, while this patch makes the write_xdrdata a local variable and makes playerc_client_writepacket thread-safe, it exceeds common stack limits, requesting 32MB on the stack.

    I'll update this tracker item soon with a new patch, which will work for playerv without changing the stack limit.

     
  • Jayen Ashar

    Jayen Ashar - 2011-04-05
     
  • Rich Mattes

    Rich Mattes - 2013-11-11

    Applied as r9134, thanks for your contribution!

     
  • Rich Mattes

    Rich Mattes - 2013-11-11
    • status: open --> closed-accepted
    • Group: Release-3.0 --> Release-3.1
     

Log in to post a comment.