August 31, 2005
mod_throttle SIGSEGV problems
You may have noticed my server down a bit yesterday.
I was trying to install mod_throttle on my server. It installed quickly/easily on another server but not mine. When installed and enabled (regardless of whether it was installed as a static module or as a DSO), apache would start up but any request would cause a segmentation fault.
I started apache up in single process mode (httpd -X) and did a gdb httpd <pid> to try and track down the problem.
I tracked it down to this call within my mod_perl code:
my $cookies = Apache::Cookie->fetch;
GDB was telling me it was happening here:
ApacheCookie_new
I confirmed this by doing this quick and dirty hack:
my $cookies = $r->header_in(’Cookie’);
my %cookielist = map { m@^\s*([^\=]+)=(.*)\s*@ } split(/\;/,$cookies);
It worked…but then I realized I was fetching cookies from many other modules…I realized that this error was only happening in the module that was being used as a PerlAccessHandler. Strange!
Anyway, I changed back my hack and wrote my simple throttling that did exactly what I wanted. Oh well.
And, BTW, I noticed on Google, while searching for gdb. that they had some extra links relevant to certain sites. Check out the links below the GDB result…they include mailing list info, download links, etc:









Emad Fanous » Blog Archive » Google’s “Additional site links” said,
September 2, 2005 @ 8:32 am
[…] I first mentioned these special links when I was searching for GDB. GDB is the Gnu Debugger (software) and it offered me small links under the GDB web page for “other ways to contact,” “documentation,” “download,” and “mailing lists.” […]