Hi Everybody,
I'm having big problems with mod_perl throwing intermittent Segmentation faults our production machines on RHEL 4 & 5.
To be able to produce a core dump on this segfaults I've installed mod_dumpcore from this tutorial:
gdb /usr/sbin/httpd core.1 produces following output:
#0 0x00b29f4b in XS_Apache__RequestRec_content_type () from /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/auto/Apache/RequestRec/RequestRec.so
and very rarely ( 1 in 15 )
#0 0x003830b9 in apr_palloc () from /usr/lib/libapr-0.so.0
The content-type is set by
$r->content_type("text/html; charset=iso-8859-1") but this is not what is causing him to segfault...
By try and error I've figured out that the segfault happens when I do a
$r->print($mypagecontent);
I've even tried to do a
unless($r->connection->aborted) {
$r->print($mypagecontent);
}
but this didn't help either.
The segfault happens randomly, between 30 and 250 mod_perl requests. There is no specific request URL or script that causes him to segfault, it just happens after some time.
More load on the server means more segfaults.
From my Apache Config:
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 256
MaxClients 200
MaxRequestsPerChild 15
</IfModule>
There are some additional Perl Modules that I've build from CPAN:
Compress-Zlib-2.004
Digest-MD5-2.39
Email-MIME-1.861
Email-MIME-ContentType-1.014
Email-MIME-Encodings-1.311
Email-Simple-2.004
Encode-Detect-1.01
ExtUtils-CBuilder-0.23
File-Slurp-9999.12
IO-Compress-Zlib-2.004
MIME-Base64-3.07
MIME-Types-1.24
Module-Build-0.2808
Pod-Escapes-1.04
Pod-Simple-3.07
String-Similarity-1.03
Template-Plugin-XML-Escape-0.02
Test-Pod-1.26
Test-Simple-0.80
Has anyone a hint where to start looking and what to do next to figure out why this segfault is happening?
Thanks
Denis