httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject [PATCH] site: more debugging tips
Date Mon, 05 Sep 2005 12:53:12 GMT
After getting bored with writing these into bugzilla for the umpteenth 
time, does this look OK?

Index: xdocs/dev/debugging.xml
===================================================================
--- xdocs/dev/debugging.xml	(revision 278729)
+++ xdocs/dev/debugging.xml	(working copy)
@@ -18,6 +18,7 @@
 <ol>
 <li><a href="#gdb">Using <code>gdb</code></a></li>
 <li><a href="#backtrace">Getting a live backtrace</a></li>
+<li><a href="#crashes">Debugging intermittent crashes</a></li>
 <li><a href="#truss">Using '<code>truss/trace/strace</code>' to
     trace system calls and signals</a></li>
 <li><a href="#gcore">Getting the server to dump core</a></li>
@@ -221,6 +222,70 @@
 </pre>
 </section>
 
+<section id="crashes">
+<title>Debugging intermittent crashes</title>
+
+<p>For situations where a child process is crashing intermittently,
+the server must be configured and started such that it produces core
+dumps which can analyzed later.</p>
+
+<p>To ensure that a core dump can be written to a directory which is
+writable by the user which child processes run as (such as
+<code>apache</code>), the <a
+href="http://httpd.apache.org/docs/2.0/mod/mpm_common.html#coredumpdirectory"><code>CoreDumpDirectory</code></a>
+directive must be added to <code>httpd.conf</code>; for example:</p>
+
+<pre>
+   CoreDumpDirectory /tmp
+</pre>
+
+<p>Before starting up the server, any process limits on core dump file
+size must be lifted; for example:</p>
+
+<pre>
+  # ulimit -c unlimited
+  # apachectl start
+</pre>
+
+<p>On some platforms, further steps might be needed to enable core
+dumps; see <a href="#sol27">Solaris 2.7 and coredumps</a> below.</p>
+
+<p>When a child process crashes, a message will be logged to the
+error_log like the following:</p>
+
+<pre>
+[Mon Sep 05 13:35:39 2005] [notice] child pid 2027 exit signal Segmentation fault (11), possible
coredump in /tmp
+</pre>
+
+<p>if the text "possible coredump in /tmp" does not appear in the
+error line, check that the ulimit was set correctly and that the
+permissions on the configured <code>CoreDumpDirectory</code> are
+suitable.</p>
+
+<p>To analyse the core dump, pass the core dump filename on the gdb
+command-line, and enter the command <code>bt full</code> at the gdb
+prompt:</p>
+
+<pre>
+  % <b>gdb /usr/local/apache2/bin/httpd /tmp/core.2027</b>
+  ...
+  Core was generated by `/usr/local/apache2/bin/httpd -k start'
+  ...
+  (gdb) <b>bt full</b>
+</pre>
+
+<p>if attempting to debug a threaded server, such as using the
+<code>worker</code> MPM, use the following gdb command:</p>
+
+<pre>
+  (gdb) <b>thread apply all bt full</b>
+</pre>
+
+<p>this will produce a backtrace for each of the threads within the
+process.</p>
+
+</section>
+
 <section id="truss">
 <title>Using 'truss/trace/strace' to trace system calls and 
 signals</title>

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Mime
View raw message