httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48094] New: Avoid a race condition by suspending worker threads before closing worker sockets
Date Sun, 01 Nov 2009 07:42:22 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=48094

           Summary: Avoid a race condition by suspending worker threads
                    before closing worker sockets
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: worker
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: bojan@rexursive.com


Created an attachment (id=24449)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24449)
(Hopefully) safe close_worker_sockets()

Current code closes worker sockets in close_worker_sockets() from the listener
thread without suspending the workers. At the same time, worker threads may be
in the process of doing the same (they may even set worker_sockets[i] to NULL,
causing a segfault in the listener), potentially causing problems.

The attached patch suspends worker threads first and then shuts down sockets,
using shutdown(). This way, worker threads can still proceed later with regular
close, without any side effects.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message