Date: Thu, 16 Oct 2008 10:40:07 +0000 (UTC) From: Alexander Leidinger <netchild@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r183942 - user/netchild/misc/src/sys/kern Message-ID: <200810161040.m9GAe7nb058302@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: netchild Date: Thu Oct 16 10:40:07 2008 New Revision: 183942 URL: http://svn.freebsd.org/changeset/base/183942 Log: Log the time of a segfault. If you don't have a syslog.conf which logs such info messages to a file, there's no trace of when this happened. With this change you at least have the possibility to grab the time from the console and try to correlate this with other things. Modified: user/netchild/misc/src/sys/kern/kern_sig.c Modified: user/netchild/misc/src/sys/kern/kern_sig.c ============================================================================== --- user/netchild/misc/src/sys/kern/kern_sig.c Thu Oct 16 10:36:47 2008 (r183941) +++ user/netchild/misc/src/sys/kern/kern_sig.c Thu Oct 16 10:40:07 2008 (r183942) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include <sys/sysent.h> #include <sys/syslog.h> #include <sys/sysproto.h> +#include <sys/time.h> #include <sys/timers.h> #include <sys/unistd.h> #include <sys/wait.h> @@ -2718,13 +2719,18 @@ sigexit(td, sig) */ if (coredump(td) == 0) sig |= WCOREFLAG; - if (kern_logsigexit) + if (kern_logsigexit) { + struct bintime now; + + getbintime(&now); log(LOG_INFO, - "pid %d (%s), uid %d: exited on signal %d%s\n", + "%zd: pid %d (%s), uid %d: exited on signal %d%s\n", + now.sec, p->p_pid, p->p_comm, td->td_ucred ? td->td_ucred->cr_uid : -1, sig &~ WCOREFLAG, sig & WCOREFLAG ? " (core dumped)" : ""); + } } else PROC_UNLOCK(p); exit1(td, W_EXITCODE(0, sig));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810161040.m9GAe7nb058302>