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 2009/08/10 21:40:17 UTC

DO NOT REPLY [Bug 47672] New: seg fault from mod_mem_cache

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

           Summary: seg fault from mod_mem_cache
           Product: Apache httpd-2
           Version: 2.2-HEAD
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Other Modules
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: poirier@pobox.com


--- Comment #0 from Dan Poirier <po...@pobox.com> 2009-08-10 12:40:14 PDT ---
Created an attachment (id=24124)
Add a per-memcache object lock to protect the cached object pool

I can produce a seg fault out of mod_mem_cache by setting the cache
expiration very short (1 second), then hitting it with bursts of
requests for the same URL every few seconds.  The stack looks like:

#0  apr_table_add (t=0x9ee2230, key=0x9f8b630 "ETag", val=0x9f8c1c8
"\"3ee9f6-22-4533a9a40f700\"") at tables/apr_tables.c:792
#1  0xb7e10521 in deep_table_copy (p=<value optimized out>, table=<value
optimized out>) at mod_mem_cache.c:559
#2  0xb7e10a9d in store_headers (h=0x9f8b2e0, r=0x9f8a200, info=0x9f2eed8) at
mod_mem_cache.c:642
#3  0xb806ed7c in cache_save_filter (f=0x9f8b988, in=0x9f8c220) at
mod_cache.c:797
#4  0x0807628b in default_handler (r=0x9f8a200) at core.c:3757
...

This appears to be due to concurrent use of mobj->pool when updating
the stored headers for a stale cached object.  Adding a lock per
memory cache object and using it to protect use of mobj->pool, I'm no
longer able to reproduce the problem.  Since the lock is per cached
object, there should be little contention for it.  (The fault was very
rare in real-world traffic.)

I'm attaching my fix for 2.2.x, since mod_mem_cache is no longer in
trunk.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 47672] seg fault from mod_mem_cache

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

Dan Poirier <po...@pobox.com> changed:

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

--- Comment #2 from Dan Poirier <po...@pobox.com> 2009-09-21 11:19:18 PDT ---
Fixed in 2.2.x, r808904

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 47672] seg fault from mod_mem_cache

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



--- Comment #1 from Eric Covener <co...@gmail.com> 2009-08-11 12:37:40 PDT ---
looks necessary to me, can you propose for "backport" in 2.2.x STATUS?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 47672] seg fault from mod_mem_cache

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


Dan Poirier <po...@pobox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |PatchAvailable


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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