f0d6ab
f0d6ab
Enable core dumps.  In upstream 3.x branch:
f0d6ab
f0d6ab
http://code.google.com/p/modwsgi/source/detail?r=b4f55d756fa816a7eae0f7edc13d5f2da3f3d5c1&name=mod_wsgi-3.X&path=/mod_wsgi.c#
f0d6ab
f0d6ab
--- mod_wsgi-3.4/configure.ac.dumpcore
f0d6ab
+++ mod_wsgi-3.4/configure.ac
f0d6ab
@@ -39,6 +39,8 @@ fi
f0d6ab
 
f0d6ab
 AC_SUBST(APXS)
f0d6ab
 
f0d6ab
+AC_CHECK_FUNCS(prctl)
f0d6ab
+
f0d6ab
 AC_MSG_CHECKING(Apache version)
f0d6ab
 HTTPD="`${APXS} -q SBINDIR`/`${APXS} -q TARGET`"
f0d6ab
 HTTPD_INCLUDEDIR="`${APXS} -q INCLUDEDIR`"
f0d6ab
--- mod_wsgi-3.4/mod_wsgi.c.coredump
f0d6ab
+++ mod_wsgi-3.4/mod_wsgi.c
f0d6ab
@@ -139,6 +139,10 @@ typedef regmatch_t ap_regmatch_t;
f0d6ab
 #include <pwd.h>
f0d6ab
 #endif
f0d6ab
 
f0d6ab
+#ifdef HAVE_SYS_PRCTL_H
f0d6ab
+#include <sys/prctl.h>
f0d6ab
+#endif
f0d6ab
+
f0d6ab
 #include "Python.h"
f0d6ab
 
f0d6ab
 #if !defined(PY_VERSION_HEX)
f0d6ab
@@ -10485,6 +10489,17 @@ static void wsgi_setup_access(WSGIDaemon
f0d6ab
                      "mod_wsgi (pid=%d): Unable to change to uid=%ld.",
f0d6ab
                      getpid(), (long)daemon->group->uid);
f0d6ab
     }
f0d6ab
+
f0d6ab
+#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
f0d6ab
+    /* this applies to Linux 2.4+ */
f0d6ab
+    if (ap_coredumpdir_configured) {
f0d6ab
+        if (prctl(PR_SET_DUMPABLE, 1)) {
f0d6ab
+            ap_log_error(APLOG_MARK, WSGI_LOG_ALERT(errno), wsgi_server,
f0d6ab
+                         "mod_wsgi (pid=%d): set dumpable failed - this child will not coredump"
f0d6ab
+                         " after software errors", getpid());
f0d6ab
+        }
f0d6ab
+    }
f0d6ab
+#endif
f0d6ab
 }
f0d6ab
 
f0d6ab
 static int wsgi_setup_socket(WSGIProcessGroup *process)