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