You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jean-Jacques Clar <JJ...@novell.com> on 2003/12/12 01:00:31 UTC

[PATCH] Page Fault in mod_mem_cache-steaming response

Bugzilla Defect #21285
This is a rework of the already posted patch.
 
It address the following situation;
1- request comes in for streaming response
2- before that request could be completed, the entry is ejected from
the cache
3- when completing the write body step, the incomplete entry is removed

before inserting the correct entry.
 
The problem is that the incomplete entry was already removed/replaced
in the cache. The cache_remove() will then seg fault.
I don't think it has something to do with the cache size has stated 
in the bug description. I will follow with a patch removing the
deprecated
cache_size and object_cnt from the mem_cache_conf struct.
 
@@ -1043,7 +1044,18 @@
      if (sconf->lock) {
          apr_thread_mutex_lock(sconf->lock);
      }
-     cache_remove(sconf->cache_cache, obj);
+    /* We need to check if the object has been removed/replaced 
+     * from/in the cache, this could happen in some cases, because 
+     * the current request is a streaming response that is handled 
+     * in multiple individual pieces. - fixing Bugzilla Defect 21285 
+     */
+    if((tmp_obj = (cache_object_t *) cache_find(sconf->cache_cache,
obj->key)) && 
+        (tmp_obj == obj)) {
+                 cache_remove(sconf->cache_cache, obj);
+    }
+    else {
+     obj->cleanup = 0;
+    }

I added the patch to the bug list of attachment.
 
Thank you,
 
Jean-Jacques

Re: [PATCH] Page Fault in mod_mem_cache-steaming response

Posted by Bill Stoddard <bi...@wstoddard.com>.
Jean-Jacques Clar wrote:

> Bugzilla Defect #21285
> This is a rework of the already posted patch.
>  
> It address the following situation;
> 1- request comes in for streaming response
> 2- before that request could be completed, the entry is ejected from the 
> cache
> 3- when completing the write body step, the incomplete entry is removed
> before inserting the correct entry.
>  
> The problem is that the incomplete entry was already removed/replaced
> in the cache. The cache_remove() will then seg fault.
> I don't think it has something to do with the cache size has stated
> in the bug description. I will follow with a patch removing the deprecated
> cache_size and object_cnt from the mem_cache_conf struct.
I will review this but it will be next week before I'll be able to get to it. This patch doesn't feel right 
but I need some time to relearn mod_mem_cache to say for sure.

Bill