Update of bug #12817 (project wesnoth):

             Assigned to:                 boucman => dave                   

    _______________________________________________________

Follow-up Comment #2:

Ok, here is what is going on.

the worker thread is in a poll call with a timeout of 60000 ms at
network_worker.cpp


the main thread calls disconnect(s=0)

which calls disconnect(socket=x,force=0) a couple of time. These calls will
never succeed because the main thread is blocked.


the we call disconnect(socket=x,force=1) which always destroys the socket
(see network_worker_pool::close_socket) however our working thread is still
in the pool

then "disconnect" will call SDLNet_TCP_Close, which will, at last get the
socket out of it's "poll"

however it's too late. we crash at network_worker.cpp:292 because the call to
disconnect(force=1) has already removed the structure we are atempting to use


The clean fix would be to somehow unblock the thread while we are doing the
disconnect with force=0 At that point a chance is given (via
SOCKET_INTERRUPT) for the thread to exit cleanly, but the thread stays
blocked on poll

I don't know the system calls well enough to know how to do that.


thx for looking

    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?12817>

_______________________________________________
  Message posté via/par Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to