- Fix the same race condition in event MPM.
- Slightly optimize code in worker MPM by removing the need for an additional
dereference operation.
- Do some word smithing on the CHANGES entry.
PR: 44402
Submitted by: Basant Kumar Kukreja <basant.kukreja sun.com>
Reviewed by: rpluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630348
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.3.0
[ When backported to 2.2.x, remove entry from this file ]
- *) Worker MPM: fix race condition in recycling a pool
- PR 44402 [Basant Kumar Kukreja <basant.kukreja sun.com>]
+ *) Worker / Event MPM: Fix race condition in pool recycling that leads to
+ segmentation faults under load. PR 44402
+ [Basant Kumar Kukreja <basant.kukreja sun.com>]
*) mod_include: Correctly handle SSI directives split over multiple filter
passes. PR 44447 [Harald Niesche <harald brokenerror.de>]
(*new_recycle));
new_recycle->pool = pool_to_recycle;
for (;;) {
- new_recycle->next = queue_info->recycled_pools;
+ /*
+ * Save queue_info->recycled_pool in local variable next because
+ * new_recycle->next can be changed after apr_atomic_casptr
+ * function call.
+ */
+ struct recycled_pool *next = queue_info->recycled_pools;
+ new_recycle->next = next;
if (apr_atomic_casptr
((volatile void **) &(queue_info->recycled_pools),
- new_recycle, new_recycle->next) == new_recycle->next) {
+ new_recycle, next) == next) {
break;
}
}
struct recycled_pool *next = queue_info->recycled_pools;
new_recycle->next = next;
if (apr_atomic_casptr((volatile void**)&(queue_info->recycled_pools),
- new_recycle, new_recycle->next) == next) {
+ new_recycle, next) == next) {
break;
}
}