You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2005/09/07 11:12:14 UTC

svn commit: r279282 - in /httpd/site/trunk: docs/dev/debugging.html xdocs/dev/debugging.xml

Author: jorton
Date: Wed Sep  7 02:12:08 2005
New Revision: 279282

URL: http://svn.apache.org/viewcvs?rev=279282&view=rev
Log:
Add section on debugging child process crashes.

Reviewed by: Noirin Plunkett, trawick, slive


Modified:
    httpd/site/trunk/docs/dev/debugging.html
    httpd/site/trunk/xdocs/dev/debugging.xml

Modified: httpd/site/trunk/docs/dev/debugging.html
URL: http://svn.apache.org/viewcvs/httpd/site/trunk/docs/dev/debugging.html?rev=279282&r1=279281&r2=279282&view=diff
==============================================================================
--- httpd/site/trunk/docs/dev/debugging.html (original)
+++ httpd/site/trunk/docs/dev/debugging.html Wed Sep  7 02:12:08 2005
@@ -73,6 +73,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>
@@ -270,6 +271,59 @@
     #3  0x44318 in standalone_main (argc=392552, argv=0x75800) at http_main.c:4273
     #4  0x449fc in main (argc=3, argv=0xefffeee4) at http_main.c:4534
     (gdb) 
+</pre>
+  </blockquote>
+ </td></tr>
+</table>
+           <table border="0" cellspacing="0" cellpadding="2" width="100%">
+ <tr><td bgcolor="#525D76">
+  <font color="#ffffff" face="arial,helvetica,sanserif">
+   <a name="crashes"><strong>Debugging intermittent crashes</strong></a>
+  </font>
+ </td></tr>
+ <tr><td>
+  <blockquote>
+<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 further.</p>
+<p>To ensure that a core dump is 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 like the following will be
+logged to the error_log:</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, for example when using
+the <code>worker</code> MPM, use the following gdb command:</p>
+<pre>
+  (gdb) <b>thread apply all bt full</b>
 </pre>
   </blockquote>
  </td></tr>

Modified: httpd/site/trunk/xdocs/dev/debugging.xml
URL: http://svn.apache.org/viewcvs/httpd/site/trunk/xdocs/dev/debugging.xml?rev=279282&r1=279281&r2=279282&view=diff
==============================================================================
--- httpd/site/trunk/xdocs/dev/debugging.xml (original)
+++ httpd/site/trunk/xdocs/dev/debugging.xml Wed Sep  7 02:12:08 2005
@@ -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>
@@ -219,6 +220,67 @@
     #4  0x449fc in main (argc=3, argv=0xefffeee4) at http_main.c:4534
     (gdb) 
 </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 further.</p>
+
+<p>To ensure that a core dump is 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 like the following will be
+logged to the error_log:</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, for example when using
+the <code>worker</code> MPM, use the following gdb command:</p>
+
+<pre>
+  (gdb) <b>thread apply all bt full</b>
+</pre>
+
 </section>
 
 <section id="truss">