Summary: | Multiple MMapFile causes Segmentation fault | ||
---|---|---|---|
Product: | Apache httpd-2 | Reporter: | John Kearns <drew> |
Component: | mod_file_cache | Assignee: | Apache HTTPD Bugs Mailing List <bugs> |
Status: | CLOSED FIXED | ||
Severity: | major | ||
Priority: | P3 | ||
Version: | 2.0.44 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | Linux |
Description
John Kearns
2003-01-22 03:13:45 UTC
aawwwww mannnnnnnnnn. :( That would be my fault. Sheesh. I'll look into it. Thanks for the report and the backtrace! Try the patch given in http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=104321419500550&w=2 and see if that fixes it for you. Assuming it stops crashing, try some server restarts and make sure you don't get any memory or file descriptor leaks. Thanks, Cliff Tried the patch...it works just fine. Out of interest though, instead of (or also with) deleting the section of code that calls the APR_RING_REMOVE define, why not just add error-checking into the APR_RING_UNSPLICE define with a couple of 'if' statements in apr_ring.h? Example: #define APR_RING_UNSPLICE(ep1, epN, link) do { \ if (APR_RING_PREV((ep1), link)) \ APR_RING_NEXT(APR_RING_PREV((ep1), link), link) = \ APR_RING_NEXT((epN), link); \ if (APR_RING_NEXT((epN), link)) \ APR_RING_PREV(APR_RING_NEXT((epN), link), link) = \ APR_RING_PREV((ep1), link); \ } while (0) I tested this modification with the original mod_file_cache.c and it seems to work as well. Although, truth be told, I'm not entirely sure how to find out if it has memory or fd leaks (I program mainly on win32...unix still mystifies me at times!) The only reason I'd suggest this is to keep this same problem happening in potential future modules that register a cleanup call for a simular list. Thanks- Drew It's a design decision we made through all of APR: we don't test for NULL. If it's NULL, that's a bug, and it will cause a segfault. If it segfaults, that's good, because it lets us find the bug very easily. Another concern is that code with no bugs will never have those pointers be NULL, so non-buggy code would be paying a performance penalty just to accommodate buggy code. Thanks for testing the patch. I'll look for leaks myself. --Cliff Heh..makes sense! Thanks for quick fix on this. Looking forward to the next release! -Drew |