<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39582 >

Christian Prochaska wrote:
> The crash happens on Windows (GTK+ client) after ending the turn and
> after the server cuts the connection "due to lagging player" while the
> client is busy for some seconds. When the client detects the lost
> connection (in this case when trying to send data to the server in
> request_new_unit_activity(punit, ACTIVITY_IDLE), called from
> set_unit_focus()) it does some cleanup and switches to the main page.
> But set_unit_focus() still continues after the
> request_new_unit_activity() call and references a now invalid unit pointer:

Interesting.  But...I thought hack connections weren't supposed to be 
cut because of lag?  When I run under valgrind I get:

2: ignoring ping timeout to hack-level connection sjolley from localhost 
(player Stephen Jolley)

many many times.  But the connection is uninterrupted.

> Now I wonder if it's really necessary to take actions on socket write
> errors on the client side at all? Since the request calls to the server
> don't return an immediate result that the client depends on, wouldn't it
> be sufficient if the client would cleanup and reset to pre-game state
> only when reading of server input fails? The attached patch fixed the
> crash and didn't show any problems for me so far.

Possibly an okay workaround.  But, I'd still want to know how exactly 
the punit_focus is getting set to an invalid (freed) pointer.  If it can 
happen here, it could happen again.


Freeciv-dev mailing list

Reply via email to