Summary: | apache and mod_auth_basic segmentation fault | ||
---|---|---|---|
Product: | Apache httpd-2 | Reporter: | erno.kovacs |
Component: | mod_auth | Assignee: | Apache HTTPD Bugs Mailing List <bugs> |
Status: | RESOLVED FIXED | ||
Severity: | critical | Keywords: | FixedInTrunk |
Priority: | P2 | ||
Version: | 2.2.15 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
Attachments: | Proposed patch |
Description
erno.kovacs
2010-06-14 14:19:34 UTC
Confused. The crash comes from a strncmp, and seems to imply that your hash is a dangling pointer and segfaults when dereferenced. Any chance of de-obfuscating the stack dump (create a non-sensitive dummy user so you can post it literally without revealing anything that matters). Also your configuration doesn't look as if it should work in 2.2. But that's a different issue, and a dicky config shouldn't cause segfault! (In reply to comment #1) > Confused. The crash comes from a strncmp, and seems to imply that your hash is > a dangling pointer and segfaults when dereferenced. Any chance of > de-obfuscating the stack dump (create a non-sensitive dummy user so you can > post it literally without revealing anything that matters). > > Also your configuration doesn't look as if it should work in 2.2. But that's a > different issue, and a dicky config shouldn't cause segfault! it must be some mpm-worker/threading issue, since i moved to mpm-prefork, the problem doesnt exist anymore. Confirming this issue with Apache 2.2.15. mpm_worker / mod_auth_basic crashes on <successful> authentication (on failing auth, everything goes smooth, mpm_prefork is okay, too). I found the reason and the (probable) solution. It's related to the ThreadStackSize. I am using reduced TSS (131072 bytes, to be precise) to reduce memory footprint of the frontend. The crypt_data structure is just too large to fit on stack (it is more than 131072 bytes in size). While increasing TSS is a viable option, I still do think keeping several tens of kilobytes of temporary data on stack sounds nonsense. So, I made a patch to malloc the structure insted (feel free to correct me there if something more effective can be used instead of malloc). Attaching a patch. Created attachment 25737 [details]
Proposed patch
Oh, and the malloc is not always thread safe. While it works for me, the patch surely requires cleanup. |