kern/60367: Erroneous "(core dumped)" in process death message

Valentin Nechayev netch at
Thu Dec 18 06:30:22 PST 2003

>Number:         60367
>Category:       kern
>Synopsis:       Erroneous "(core dumped)" in process death message
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 18 06:30:15 PST 2003
>Originator:     Valentin Nechayev
>Release:        FreeBSD 5.2-RC-20031208 i386
FreeBSD 5.2-RC


On mortal signal, sigexit() in sys/kern/kern_sig.c calls coredump()
for some signals (with SA_CORE flag in property table) and marks exit status
with WCOREFLAG if it returned 0.
coredump() in the same source file returns 0 on successful core write,
and errno codes in most cases, but not when core dump is prohibited
by resource limit (p->p_rlimit[RLIMIT_CORE].rlim_cur), instead returning 0.
I think it is simply typo. As result, kernel says "process exited on signal
N (core dumped)" when no core was even supposed to be dumped.


ulimit -Sc 0 (in sh/bash) and run something which deads on SIGSEGV.


For 5.2:

--- kern_sig.c.0	Mon Nov  3 14:09:06 2003
+++ kern_sig.c	Thu Dec 18 16:20:00 2003
@@ -2546,7 +2546,7 @@
 	limit = p->p_rlimit[RLIMIT_CORE].rlim_cur;
 	if (limit == 0) {
-		return 0;
+		return (ENOSPC);
For 4.8, the same patch is to be apply in some different context
(without PROC_UNLOCK).

I selected ENOSPC, but really error code doesn't matter while it is !=0.

More information about the freebsd-bugs mailing list