You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2014/06/18 20:23:57 UTC

[Bug 56639] New: Race condition in Event MPM

https://issues.apache.org/bugzilla/show_bug.cgi?id=56639

            Bug ID: 56639
           Summary: Race condition in Event MPM
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: PC
                OS: Linux
            Status: NEW
          Keywords: PatchAvailable
          Severity: normal
          Priority: P2
         Component: mpm_event
          Assignee: bugs@httpd.apache.org
          Reporter: Chaosed0@gmail.com

Created attachment 31725
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31725&action=edit
Fix event MPM race condition on connection scoreboard handle

In event.c, process_socket(), if a worker thread is put into the lingering
close state, it is put into the linger_q (or short_linger_q). Shortly
afterward, the scoreboard handle of the connection handled by that thread is
set to NULL. Meanwhile, in the listener thread, process_lingering_close() is
called on any connections in the linger_q that are closed. This also clears the
transaction pool, making it available for other workers to use. Most of the
time, this is fine, but in the worst case, this can result in a race condition;
the listener thread may assign the pool to another thread between the time the
pool is cleared and the time c->sbh is set to NULL. This can be a problem for
third-party modules which access the scoreboard using the connection scoreboard
handle at arbitrary times.

This problem appears to be very close to revision 1538490, but that fix covers
every case except for the lingering close fixed here.

-- 
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


[Bug 56639] Race condition in Event MPM

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56639

--- Comment #3 from Edward Lu <Ch...@gmail.com> ---
Created attachment 31747
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31747&action=edit
Move sbh nullification to correct place

I just realized that I nulled the sbh out in the wrong place in the last patch
- it's supposed to be before the connection is added to the queue, not the
pollset. This patch is on top of what was just committed.

-- 
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


[Bug 56639] Race condition in Event MPM

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56639

Edward Lu <Ch...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31725|0                           |1
        is obsolete|                            |

--- Comment #1 from Edward Lu <Ch...@gmail.com> ---
Created attachment 31726
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31726&action=edit
Fix event MPM race condition on connection scoreboard handle

Wrong patch before - still had some things I was experimenting with

-- 
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


[Bug 56639] Race condition in Event MPM

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56639

Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |FixedInTrunk

--- Comment #2 from Eric Covener <co...@gmail.com> ---
Thanks, committed and proposed for backport.

-- 
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


[Bug 56639] Race condition in Event MPM

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56639

Christophe JAILLET <ch...@wanadoo.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Christophe JAILLET <ch...@wanadoo.fr> ---
Fixed and released in 2.4.10

-- 
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