NetBSD Problem Report #51944

From martin@duskware.de  Sat Feb  4 17:13:38 2017
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id ACEDA7A1AE
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  4 Feb 2017 17:13:38 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: sparse core dumps do not work
X-Send-Pr-Version: 3.95

>Number:         51944
>Category:       port-amd64
>Synopsis:       sparse core dumps do not work
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    maya
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 04 17:15:00 +0000 2017
>Closed-Date:    Sun Feb 26 02:54:33 +0000 2017
>Last-Modified:  Sun Feb 26 02:54:33 +0000 2017
>Originator:     Martin Husemann
>Release:        NetBSD 7.99.59
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD night-owl.duskware.de 7.99.59 NetBSD 7.99.59 (NIGHT-OWL) #479: Thu Feb 2 21:44:14 CET 2017 martin@night-owl.duskware.de:/usr/src/sys/arch/amd64/compile/NIGHT-OWL amd64
Architecture: x86_64
Machine: amd64
>Description:

Kernel crash dumps do not work in -current on amd64:

Manually transcripted from a slightly fuzzy photo:

kernel: protection fault trap, code=0
Stopped in pid 0.5 (system) at netbsd:Xsoftintr+0x40: movl 0(%rax),%esi
[.. ignore upto here, now the interesting part starts ..]

db{0}> sync

dumping to dev 8,1 (offset=4481653, size=1012867):
dump fatal page fault in supervisor mode
trap type 6 code 0 rip fffffff80218d9f cs 8 rflags 10246 cr2 38 ilevel 8 rsp ffffe88bf7a6ab8
curlwp 0xffffe8137b3a8e8 pid 0.5 lowest kstack 0xfffffe80bf7a32c8
kernel: page fault trap, code=0
Stopped in pid 0.5 (system) at netbsd:sparse_dump_mark+0x10b: cmpq $0,38(%rax)

Looking that up in netbsd.gdb:

0xffffffff80218d9f is in sparse_dump_mark (../../../../arch/amd64/amd64/machdep.c:820).
815                      * We assume that seg->start to seg->end are
816                      * uvm_page_physload()ed
817                      */
818                     for (pfn = startpfn; pfn <= endpfn; pfn++) {
819                             pg = PHYS_TO_VM_PAGE(ptoa(pfn));
820                             if (pg->uanon || (pg->pqflags & PQ_FREE) ||
821                                 (pg->uobject && pg->uobject->pgops)) {
822                                     p = VM_PAGE_TO_PHYS(pg) / PAGE_SIZE;
823                                     clrbit(sparse_dump_physmap, p);
824                             }



>How-To-Repeat:
Try to get a crash dump.

>Fix:
n/a

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-amd64-maintainer->maya
Responsible-Changed-By: maya@NetBSD.org
Responsible-Changed-When: Sat, 04 Feb 2017 18:39:44 +0000
Responsible-Changed-Why:

--- amd64/machdep.c	26 Dec 2016 17:54:06 -0000	1.246
+++ amd64/machdep.c	4 Feb 2017 17:58:52 -0000
@@ -815,7 +815,7 @@ sparse_dump_mark(void)
 		 * We assume that seg->start to seg->end are
 		 * uvm_page_physload()ed
 		 */
-		for (pfn = startpfn; pfn <= endpfn; pfn++) {
+		for (pfn = startpfn; pfn < endpfn; pfn++) {
 			pg = PHYS_TO_VM_PAGE(ptoa(pfn));
 			if (pg->uanon || (pg->pqflags & PQ_FREE) ||
 			    (pg->uobject && pg->uobject->pgops)) {




From: "Maya Rashish" <maya@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51944 CVS commit: src/sys/arch/amd64/amd64
Date: Sun, 5 Feb 2017 06:13:53 +0000

 Module Name:	src
 Committed By:	maya
 Date:		Sun Feb  5 06:13:53 UTC 2017

 Modified Files:
 	src/sys/arch/amd64/amd64: machdep.c

 Log Message:
 Fix off by one.

 Fixes PR port-amd64/51944: sparse core dumps do not work


 To generate a diff of this commit:
 cvs rdiff -u -r1.247 -r1.248 src/sys/arch/amd64/amd64/machdep.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sun, 26 Feb 2017 02:54:33 +0000
State-Changed-Why:
fixed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.