From nobody@FreeBSD.org  Tue Oct  7 12:16:13 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8CECF1065699
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  7 Oct 2008 12:16:13 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 7B56A8FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Tue,  7 Oct 2008 12:16:13 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id m97CGDEw014431
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 7 Oct 2008 12:16:13 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id m97CGDHm014430;
	Tue, 7 Oct 2008 12:16:13 GMT
	(envelope-from nobody)
Message-Id: <200810071216.m97CGDHm014430@www.freebsd.org>
Date: Tue, 7 Oct 2008 12:16:13 GMT
From: pluknet <pluknet@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] dumpon rejects on start with physmem>swap even with minidump=1
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         127917
>Category:       conf
>Synopsis:       [patch] dumpon rejects on start with physmem>swap even with minidump=1
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-rc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 07 12:20:02 UTC 2008
>Closed-Date:    Fri Nov 12 07:31:41 UTC 2010
>Last-Modified:  Fri Nov 12 07:31:41 UTC 2010
>Originator:     pluknet
>Release:        6.2-R
>Organization:
RIPN
>Environment:
FreeBSD jaw.ripn.net 6.2-RELEASE-p12 FreeBSD 6.2-RELEASE-p12 #86: Tue Oct  7 15:43:58 MSD 2008     root@jaw.ripn.net:/usr/obj/usr/src/sys/JAW  i386
>Description:
Minidump feature allows to dump kcore even with physical memory less than
size of a swap device.

$ sysctl debug.minidump=0
debug.minidump: 1 -> 0
$ /etc/rc.d/dumpon start
/dev/ad0s1b is smaller than physical memory
$ sysctl debug.minidump=1
debug.minidump: 0 -> 1
$ /etc/rc.d/dumpon start
kernel dumps on /dev/ad0s1b

All right. But it does not always work on boot (of course,
with properly set debug.minidump=1 in /etc/sysctl.conf)
and we have on boot:
/dev/ad0s1b is smaller than physical memory.

>How-To-Repeat:
Get a lesser swap slice then phys memory size.
Set sysctl debug.minidump=1 in /etc/sysctl.conf
Place dumpdev="/dev/ad0s1b" (according to your setup) in /etc/rc.conf
Reboot.
>Fix:
 That's because /etc/rc.d/dumpon starts before /etc/rc.d/sysctl.
To be fixed.
-----------
--- /etc/rc.d/dumpon.orig       Tue Oct  7 16:09:52 2008
+++ /etc/rc.d/dumpon    Tue Oct  7 15:49:42 2008
@@ -5,6 +5,7 @@
 
 # PROVIDE: dumpon
 # BEFORE: disks savecore initrandom
+# REQUIRE: sysctl
 # KEYWORD: nojail
 
 . /etc/rc.subr
-----------

After fix (dmesg -a):
---
/dev/ad0s1d: clean, 417342 free (694 frags, 52081 blocks, 0.1% fragmentation)
net.inet6.ip6.auto_linklocal: 
1
 -> 
0

hw.syscons.bell: 
1
 -> 
0

debug.minidump: 
0
 -> 
1

kernel dumps on /dev/ad0s1b
Entropy harvesting:
---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Tue Oct 7 12:25:24 UTC 2008 
Responsible-Changed-Why:  
Patch against /etc/rc.d/dumpon. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127917 

From: Andriy Gapon <avg@icyb.net.ua>
To: bug-followup@FreeBSD.org, pluknet@gmail.com
Cc:  
Subject: Re: conf/127917: [patch] dumpon rejects on start with physmem&gt;swap
 even with minidump=1
Date: Thu, 11 Nov 2010 20:29:02 +0200

 I think that this PR can now be closed as minidump
 1) is enabled by default
 2) can be enabled via a tunable
 
 -- 
 Andriy Gapon

From: Sergey Kandaurov <pluknet@gmail.com>
To: Andriy Gapon <avg@icyb.net.ua>
Cc: bug-followup@freebsd.org
Subject: Re: conf/127917: [patch] dumpon rejects on start with physmem&gt;swap
 even with minidump=1
Date: Fri, 12 Nov 2010 07:13:18 +0300

 > I think that this PR can now be closed as minidump
 > 1) is enabled by default
 > 2) can be enabled via a tunable
 
 p.1 is true only for v7+ (and this PR is also for v6,
 as far as minidump is off there by default).
 However, even in 6.x one can workaround the issue
 by setting the debug.minidump loader tunable into 1,
 so p.2 is true for all versions, thus PR could be closed.
State-Changed-From-To: open->closed 
State-Changed-By: pluknet 
State-Changed-When: Fri Nov 12 07:23:51 UTC 2010 
State-Changed-Why:  
This PR can be worked around by setting debug.minidump="1" in loader, 
thus it's handled before rc.d.  Since fixing this PR would require messing 
with rcorder with unknown possible side-effects, and FreeBSD 6.x with EoL 
coming soon is only affected, just close this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127917 
>Unformatted:
