You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2012/11/28 17:33:19 UTC

svn commit: r1414796 - in /httpd/httpd/branches/2.4.x: ./ STATUS server/mpm/winnt/child.c

Author: jim
Date: Wed Nov 28 16:33:18 2012
New Revision: 1414796

URL: http://svn.apache.org/viewvc?rev=1414796&view=rev
Log:
Merge r1374874 from trunk:

WinNT MPM: Fix thread-safety issue in worker_main().  All
workers were allocating from pchild without holding '
child_lock.  Allocate from ptrans instead.

Related to: PR 52196

The reporter suggests that the apr_thread_t for r->connection->current_thread
should have a unique pool.  This revision handles that for WinNT MPM,
but not for other MPMs.

Submitted by: trawick
Reviewed/backported by: jim

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1374874

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1414796&r1=1414795&r2=1414796&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Wed Nov 28 16:33:18 2012
@@ -89,10 +89,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * WinNT MPM thread-safety issue at child startup
-     trunk patch: http://svn.apache.org/viewvc?view=revision&sortby=date&revision=1374874
-     2.4.x patch: trunk patch works
-     +1: trawick, gsmith, covener
 
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:

Modified: httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c?rev=1414796&r1=1414795&r2=1414796&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c (original)
+++ httpd/httpd/branches/2.4.x/server/mpm/winnt/child.c Wed Nov 28 16:33:18 2012
@@ -761,7 +761,7 @@ apr_status_t winnt_insert_network_bucket
  */
 static DWORD __stdcall worker_main(void *thread_num_val)
 {
-    apr_thread_t *thd = NULL;
+    apr_thread_t *thd;
     apr_os_thread_t osthd;
     static int requests_this_child = 0;
     winnt_conn_ctx_t *context = NULL;
@@ -773,7 +773,6 @@ static DWORD __stdcall worker_main(void 
     apr_int32_t disconnected;
 
     osthd = apr_os_thread_current();
-    apr_os_thread_put(&thd, &osthd, pchild);
 
     while (1) {
 
@@ -811,6 +810,8 @@ static DWORD __stdcall worker_main(void 
             continue;
         }
 
+        thd = NULL;
+        apr_os_thread_put(&thd, &osthd, context->ptrans);
         c->current_thread = thd;
 
         /* follow ap_process_connection(c, context->sock) logic