~ubuntu-branches/ubuntu/jaunty/apache2/jaunty-proposed

« back to all changes in this revision

Viewing changes to debian/patches/066_mpm_worker_segfault_PR45605.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2008-12-15 00:06:50 UTC
  • mfrom: (14.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20081215000650-5ovq2vvvrtmn5r1l
Tags: 2.2.11-1ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/{control, rules}: enable PIE hardening.
  - debian/{control, rules, apache2.2-common.ufw.profile}: add ufw profiles.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
##
3
 
## All lines beginning with `## DP:' are a description of the patch.
4
 
## DP:see http://svn.apache.org/viewvc?view=rev&revision=705872
5
 
--- a/server/mpm/worker/fdqueue.c       (revision 705871)
6
 
+++ a/server/mpm/worker/fdqueue.c       (revision 705872)
7
 
@@ -155,7 +155,15 @@
8
 
          * region, one of two things may have happened:
9
 
          *   - If the idle worker count is still zero, the
10
 
          *     workers are all still busy, so it's safe to
11
 
-         *     block on a condition variable.
12
 
+         *     block on a condition variable, BUT
13
 
+         *     we need to check for idle worker count again
14
 
+         *     when we are signaled since it can happen that
15
 
+         *     we are signaled by a worker thread that went idle
16
 
+         *     but received a context switch before it could
17
 
+         *     tell us. If it does signal us later once it is on
18
 
+         *     CPU again there might be no idle worker left.
19
 
+         *     See
20
 
+         *     https://issues.apache.org/bugzilla/show_bug.cgi?id=45605#c4
21
 
          *   - If the idle worker count is nonzero, then a
22
 
          *     worker has become idle since the first check
23
 
          *     of queue_info->idlers above.  It's possible
24
 
@@ -166,7 +174,7 @@
25
 
          *     now nonzero, it's safe for this function to
26
 
          *     return immediately.
27
 
          */
28
 
-        if (queue_info->idlers == 0) {
29
 
+        while (queue_info->idlers == 0) {
30
 
             rv = apr_thread_cond_wait(queue_info->wait_for_idler,
31
 
                                   queue_info->idlers_mutex);
32
 
             if (rv != APR_SUCCESS) {