Support This Project

Ticket #129 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] wzdftpd crashes upon stopping the service (Windows)

Reported by: virdiq Assigned to: virdiq
Priority: normal Milestone: 0.8.2
Component: server core Version: 0.8.1
Severity: crash Keywords: CONFIRMED PATCH REVIEW
Cc:

Description

When wzdftpd is running as a service on Windows and the service is stopped, wzdftpd crashes with an error message.

zonp has also confirmed this bug.

Attachments

Ticket129_Patch_Revision1.diff (0.7 kB) - added by virdiq on 06/27/07 15:37:54.
Revision 1 of patch for ticket #129

Change History

06/01/07 20:19:44 changed by virdiq

  • status changed from new to assigned.

06/27/07 15:37:54 changed by virdiq

  • attachment Ticket129_Patch_Revision1.diff added.

Revision 1 of patch for ticket #129

06/27/07 15:48:38 changed by virdiq

  • keywords changed from CONFIRMED to CONFIRMED PATCH REVIEW.
  • status changed from assigned to closed.
  • summary changed from wzdftpd crashes upon stopping the service (Windows) to [PATCH] wzdftpd crashes upon stopping the service (Windows).
  • resolution set to fixed.
  • milestone set to 0.8.2.

Fixed in r1744.

The problem here was that a select() call in the main client thread loop had a time interval of 10sec and therefore the thread exit flag might not be checked for up to 10sec.

When shutting the server down, wzdftpd only waited 3sec for client threads to die, which is not enough time.

The server would continue anyway and unload the backends... while the client thread was still active. The client thread would then try and access memory which was part of the now unloaded backend, and the server would crash.

The maximum wait for client threads to exit has been increased to 20sec which is 2x what we theoretically need... but it has some safety margin to cater for servers which are under extreme load or have weird problems with select().