Hello.
On Sat, Nov 29, 2003 at 10:15:29PM -0800, Blair Zajac wrote:
> Won't doing something like this work on Linux?
>
> --- src/main/http_main.c.0 2002-09-27 10:40:24.000000000 -0700
> +++ src/main/http_main.c 2003-06-26 17:11:35.000000000 -0700
> @@ -123,6 +123,7 @@
> #ifdef HAVE_BSTRING_H
> #include <bstring.h> /* for IRIX, FD_SET calls bzero() */
> #endif
> +#include <sys/prctl.h>
>
> #ifdef MULTITHREAD
> /* special debug stuff -- PCS */
> @@ -4261,6 +4262,17 @@
> }
> #endif
>
> + if (strlen(ap_coredump_dir)) {
> + if (prctl(PR_SET_DUMPABLE, 1)) {
> + ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
> + "set dumpable failed - this child will not coredump"
> + " after software errors");
> + } else {
> + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf,
> + "set dumpable succeeded");
> + }
> + }
> +
> ap_child_init_modules(pchild, server_conf);
>
> /* done with the initialization critical section */
>
> There's a similar call to prctl(PR_SET_DUMPABLE, 1) in the http
> 2.0 tree.
Well, that's basically what Jeff's mod_prctl does:
http://www.apache.org/~trawick/mod_prctl.c
and the problem here is RedHat or Linux-2.4's soft core size limit
defaults to 0. You might want to change the /etc/profile
# No core files by default
#ulimit -S -c 0 > /dev/null 2>&1 <-- original
ulimit -S -c unlimited > /dev/null 2>&1 <-- what I added
Actually, just commenting out the original ulimit line won't change
the soft corefile size to unlimited; I think it must be hard-coded
in the kernel, or another ulimit it set somewhere deep inside /etc
directory. Anyway, after changing this, I can get a core file using
mod_prctl.