Changes with Apache 1.3.30
+ *) Linux 2.4+: If Apache is started as root and you code
+ CoreDumpDirectory, coredumps are enabled via the prctl() syscall.
+ Backport of a 2.x feature by Greg Ames. [Jeff Trawick]
+
*) Fix bug causing core dump when using CookieTracking without
specifying a CookieName directly. Bugz# 24483.
[Manni Wood <manniwood planet-save.com>, Jim Jagielski (backport)]
if ./helpers/TestCompile lib crypt; then
LIBS="$LIBS -lcrypt"
fi
+ # see if prctl(PR_SET_DUMPABLE) is available
+ if TCADDINCL='#include <sys/prctl.h>
+static int required_flag = PR_SET_DUMPABLE;' ./helpers/TestCompile sizeof required_flag ; then
+ if ./helpers/TestCompile func prctl; then
+ CFLAGS="$CFLAGS -DHAVE_SET_DUMPABLE"
+ fi
+ fi
;;
*-dg-dgux*)
#ifdef HAVE_BSTRING_H
#include <bstring.h> /* for IRIX, FD_SET calls bzero() */
#endif
+#ifdef HAVE_SET_DUMPABLE /* certain levels of Linux */
+#include <sys/prctl.h>
+#endif
#ifdef MULTITHREAD
/* special debug stuff -- PCS */
API_VAR_EXPORT char ap_server_root[MAX_STRING_LEN]="";
API_VAR_EXPORT char ap_server_confname[MAX_STRING_LEN]="";
-API_VAR_EXPORT char ap_coredump_dir[MAX_STRING_LEN]="";
+#define DEFAULT_COREDUMP_DIR ""
+API_VAR_EXPORT char ap_coredump_dir[MAX_STRING_LEN]=DEFAULT_COREDUMP_DIR;
API_VAR_EXPORT array_header *ap_server_pre_read_config=NULL;
API_VAR_EXPORT array_header *ap_server_post_read_config=NULL;
}
#endif
+#ifdef HAVE_SET_DUMPABLE
+ if (strcmp(ap_coredump_dir, DEFAULT_COREDUMP_DIR)) {
+ /* user set CoredumpDirectory, so they want to get core dumps
+ */
+ if (prctl(PR_SET_DUMPABLE, 1)) {
+ ap_log_error(APLOG_MARK, APLOG_ALERT, NULL,
+ "set dumpable failed - this child will not coredump"
+ " after software errors");
+ }
+ }
+#endif
+
ap_child_init_modules(pchild, server_conf);
/* done with the initialization critical section */