Clinton Gormley wrote:
Hi Tyler
I know next to nothing about reading backtraces, but it looks to me like
your segfault is occurring while your program is trying to parse the
headers.
Before doing any more, I would compile my own version of Apache2,
mod_perl2 and libapreq2, and see if it still occurs.
With regards your previous question about persistent DB handles, it
doesn't look to me as though your segfault is from this source, but here
are some thought anyway:
- Apache::DBI is supposed to not cache DB connections during startup
- I remember submitting a patch ages ago
http://www.issociate.de/board/post/299107/Patch_for_Apache::DBI_v_0.9901_under_MP2_using_prefork.html
which was not applied. If I look at the code now, I think it has
changed, so it may well work (I don't use it anymore), but it is
worth testing that it is actually happening.
- The problem in the original code was that the use of restart_count
did not reflect the situation we were trying to catch. I forget
the details now.
- Don't forget, if you store a DBI handle in a global during parent,
startup and never disconnect it, then it will be live in the
children.
- It either has to go out of scope, or be manually disconnected (and
if you're using Apache::DBI, your disconnect is overridden).
hth
clint
On Thu, 2007-05-24 at 17:34 -0600, Tyler Bird wrote:
hey guys I read a little more and was able to generate a backtrace for
my apache children segfaulting here it is below.
Program terminated with signal 11, Segmentation fault.
#0 0x0051389a in apr_palloc () from /usr/lib/libapr-1.so.0
(gdb) bt
#0 0x0051389a in apr_palloc () from /usr/lib/libapr-1.so.0
#1 0x0050bfed in apr_table_make () from /usr/lib/libapr-1.so.0
#2 0x00b8d9bc in ap_scan_script_header_err_core () from /usr/sbin/httpd
#3 0x00b8e006 in ap_scan_script_header_err_strs () from /usr/sbin/httpd
#4 0x006a60a0 in modperl_cgi_header_parse () from
/etc/httpd/modules/mod_perl.so
#5 0x00906544 in XS_Apache2__RequestRec_send_cgi_header ()
from
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/Apache2/Response/Response.so
#6 0x0435c43d in Perl_pp_entersub () from
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so
#7 0x0435589f in Perl_runops_standard ()
from /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so
#8 0x042f5fee in Perl_magicname () from
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so
#9 0x042fa7e6 in Perl_call_sv () from
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so
#10 0x0069a77f in modperl_callback () from /etc/httpd/modules/mod_perl.so
#11 0x0069ae7a in modperl_callback_run_handlers () from
/etc/httpd/modules/mod_perl.so
#12 0x0069b4ea in modperl_callback_per_dir () from
/etc/httpd/modules/mod_perl.so
#13 0x0069464f in modperl_response_init () from
/etc/httpd/modules/mod_perl.so
#14 0x0069481b in modperl_response_handler_cgi () from
/etc/httpd/modules/mod_perl.so
#15 0x00b8785d in ap_run_handler () from /usr/sbin/httpd
#16 0x00b8b208 in ap_invoke_handler () from /usr/sbin/httpd
#17 0x00b971ce in ap_process_request () from /usr/sbin/httpd
#18 0x00b93fbf in ap_register_input_filter () from /usr/sbin/httpd
#19 0x00b8f71d in ap_run_process_connection () from /usr/sbin/httpd
#20 0x00b8f81c in ap_process_connection () from /usr/sbin/httpd
#21 0x00b9b782 in ap_graceful_stop_signalled () from /usr/sbin/httpd
#22 0x00b9ba91 in ap_graceful_stop_signalled () from /usr/sbin/httpd
#23 0x00b9bb6a in ap_graceful_stop_signalled () from /usr/sbin/httpd
#24 0x00b9c6cb in ap_mpm_run () from /usr/sbin/httpd
#25 0x00b730d7 in main () from /usr/sbin/httpd
any ideas on what I can do to keep it from segfaulting again?
Tyler
Clint,
I changed the header I sent from text/html to text/plain and the
segfaulting no longer occuring.
What I am doing to reproduce this is 1.) repeatedly refreshing a page.
2.) refresing page repeatedly but waiting 4 seconds between refreshes I
get the segfault randomly when I do both cases.
I am going to recompile next.