From owner-svn-src-head@freebsd.org  Wed Jun 26 03:32:17 2019
Return-Path: <owner-svn-src-head@freebsd.org>
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D4BC15DE5E6;
 Wed, 26 Jun 2019 03:32:17 +0000 (UTC)
 (envelope-from cy.schubert@cschubert.com)
Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "Client", Issuer "CA" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id E03448AD10;
 Wed, 26 Jun 2019 03:32:15 +0000 (UTC)
 (envelope-from cy.schubert@cschubert.com)
Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA
 id fyfNhmWDUo7SQfyfOhcpmq; Tue, 25 Jun 2019 21:32:14 -0600
X-Authority-Analysis: v=2.3 cv=Go88BX9C c=1 sm=1 tr=0
 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17
 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=dq6fvYVFJ5YA:10
 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=hhWWyWAOk7TUdWXy1xYA:9
 a=oZqBB_jpOfjAqMcn:21 a=DkvMeU1PYl3GNetm:21 a=CjuIK1q_8ugA:10
 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22
Received: from slippy.cwsent.com (slippy [10.1.1.91])
 by spqr.komquats.com (Postfix) with ESMTPS id CEA10D4;
 Tue, 25 Jun 2019 20:32:12 -0700 (PDT)
Received: from slippy.cwsent.com (localhost [127.0.0.1])
 by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x5Q3WCBm004935;
 Tue, 25 Jun 2019 20:32:12 -0700 (PDT)
 (envelope-from Cy.Schubert@cschubert.com)
Received: from slippy (cy@localhost)
 by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x5Q3WCIG004876;
 Tue, 25 Jun 2019 20:32:12 -0700 (PDT)
 (envelope-from Cy.Schubert@cschubert.com)
Message-Id: <201906260332.x5Q3WCIG004876@slippy.cwsent.com>
X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs
X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1
Reply-to: Cy Schubert <Cy.Schubert@cschubert.com>
From: Cy Schubert <Cy.Schubert@cschubert.com>
X-os: FreeBSD
X-Sender: cy@cwsent.com
X-URL: http://www.cschubert.com/
To: Doug Moore <dougm@FreeBSD.org>
cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org, Larry Rosenman <ler@lerctr.org>
Subject: Re: svn commit: r349393 - head/sys/vm
In-Reply-To: Message from Doug Moore <dougm@FreeBSD.org> of "Tue,
 25 Jun 2019 20:25:16 -0000." <201906252025.x5PKPGml014589@repo.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Tue, 25 Jun 2019 20:32:12 -0700
X-CMAE-Envelope: MS4wfDxx29+0Jg5Rd2oNxscgV+WCRQ29QqgBetJkvHQ7Aj36pT7gmFb5jdEe9T3GNSL261i+TtAWFqAIJGG9mbB4lmNYJPUfKBAV0YhmJ+VpZ4QXmrL53q0I
 keqBDS5H81ntgr2Lr5BH1kOvDTrimdT+A1QQpfdn/rDmiUtLGLlp9ND82b5yNsvBa4wZY6sMbys7T97XM9gOfM38zHQiF7CMG+x5fS/M/o520A32d5LJLRDy
 qwknoOoVgGyRohMDne7axD8HvgyFSN7o4VpMSO9zCXkoih8i7bCkaMUIWszmMuRjnEmRMgDWs5qRlEGce0UY9A==
X-Rspamd-Queue-Id: E03448AD10
X-Spamd-Bar: ----
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-4.98 / 15.00]; ARC_NA(0.00)[];
 RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5];
 RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11];
 FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[];
 NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain];
 HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com];
 RCPT_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[];
 TO_MATCH_ENVRCPT_SOME(0.00)[];
 MX_GOOD(-0.01)[cached: spqr.komquats.com];
 NEURAL_HAM_SHORT(-0.87)[-0.875,0];
 NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[];
 FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[];
 MIME_TRACE(0.00)[0:+];
 ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA];
 RCVD_TLS_LAST(0.00)[];
 IP_SCORE(-2.40)[ip: (-6.08), ipnet: 64.59.128.0/20(-3.28), asn: 6327(-2.54),
 country: CA(-0.09)]; 
 RCVD_IN_DNSWL_LOW(-0.10)[139.136.59.64.list.dnswl.org : 127.0.5.1]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 <svn-src-head.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head/>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 26 Jun 2019 03:32:17 -0000

In message <201906252025.x5PKPGml014589@repo.freebsd.org>, Doug Moore 
writes:
> Author: dougm
> Date: Tue Jun 25 20:25:16 2019
> New Revision: 349393
> URL: https://svnweb.freebsd.org/changeset/base/349393
>
> Log:
>   Eliminate some uses of the prev and next fields of vm_map_entry_t.
>   
>   Since the only caller to vm_map_splay is vm_map_lookup_entry, move the
>   implementation of vm_map_splay into vm_map_lookup_helper, called by
>   vm_map_lookup_entry.
>   
>   vm_map_lookup_entry returns the greatest entry less than or equal to a
>   given address, but in many cases the caller wants the least entry
>   greater than or equal to the address and uses the next pointer to get
>   to it. Provide an alternative interface to lookup,
>   vm_map_lookup_entry_ge, to provide the latter behavior, and let
>   callers use one or the other rather than having them use the next
>   pointer after a lookup miss to get what they really want.
>   
>   In vm_map_growstack, the caller wants an entry that includes a given
>   address, and either the preceding or next entry depending on the value
>   of eflags in the first entry. Incorporate that behavior into
>   vm_map_lookup_helper, the function that implements all of these
>   lookups.
>   
>   Eliminate some temporary variables used with vm_map_lookup_entry, but
>   inessential.
>   
>   Reviewed by: markj (earlier version)
>   Approved by: kib (mentor)
>   Differential Revision: https://reviews.freebsd.org/D20664
>
> Modified:
>   head/sys/vm/vm_map.c
>   head/sys/vm/vm_map.h
>
[...]

Hi Doug,

This commit causes the following panic. The panic occurs during UFS fsck.
Booting into single user and issuing fsck by hand also results in the
panic. Reverting this rev provides relief.

<118>Starting file system checks:


Fatal trap 12: page fault while in kernel mode
cpuid = 1; apic id = 01
fault virtual address	= 0x52
fault code		= supervisor read data, page not present
instruction pointer	= 0x20:0xffffffff809649b4
stack pointer	        = 0x0:0xfffffe0035853810
frame pointer	        = 0x0:0xfffffe00358538f0
code segment		= base 0x0, limit 0xfffff, type 0x1b
			= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags	= interrupt enabled, resume, IOPL = 0
current process		= 62 (fsck_ufs)
trap number		= 12
panic: page fault
cpuid = 1
time = 1561490154
KDB: stack backtrace:
#0 0xffffffff806bff77 at kdb_backtrace+0x67
#1 0xffffffff806744fd at vpanic+0x19d
#2 0xffffffff80674353 at panic+0x43
#3 0xffffffff809adcdc at trap_fatal+0x39c
#4 0xffffffff809add29 at trap_pfault+0x49
#5 0xffffffff809ad31f at trap+0x29f
#6 0xffffffff80989125 at calltrap+0x8
#7 0xffffffff80956702 at vm_fault_hold+0x72
#8 0xffffffff80956640 at vm_fault+0x60
#9 0xffffffff809ade44 at trap_pfault+0x164
#10 0xffffffff809ad4ab at trap+0x42b
#11 0xffffffff80989125 at calltrap+0x8
Uptime: 22s
Dumping 302 out of 4068 MB:..6%..11%..22%..32%..43%..53%..64%..74%..85%.
.96%

__curthread () at /opt/src/svn-current/sys/amd64/include/pcpu.h:246
246		__asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (OFFSETOF_CURTHREAD));
(kgdb) bt
#0  __curthread () at /opt/src/svn-current/sys/amd64/include/pcpu.h:246
#1  doadump (textdump=<optimized out>) at /opt/src/svn-current/sys/kern/
kern_shutdown.c:392
#2  0xffffffff806740b8 in kern_reboot (howto=260) at 
/opt/src/svn-current/sys/kern/kern_shutdown.c:479
#3  0xffffffff80674559 in vpanic (fmt=<optimized out>, ap=<optimized 
out>) at /opt/src/svn-current/sys/kern/kern_shutdown.c:905
#4  0xffffffff80674353 in panic (fmt=<unavailable>) at 
/opt/src/svn-current/sys/kern/kern_shutdown.c:832
#5  0xffffffff809adcdc in trap_fatal (frame=0xfffffe0035853750, eva=82) 
at /opt/src/svn-current/sys/amd64/amd64/trap.c:943
#6  0xffffffff809add29 in trap_pfault (frame=0xfffffe0035853750, 
usermode=0) at /opt/src/svn-current/sys/amd64/amd64/trap.c:767
#7  0xffffffff809ad31f in trap (frame=0xfffffe0035853750) at 
/opt/src/svn-current/sys/amd64/amd64/trap.c:443
#8  <signal handler called>
#9  0xffffffff809649b4 in vm_map_growstack (map=0xfffff80005757000, 
addr=140737487298560, gap_entry=0xfffff8000546a9a0) at 
/opt/src/svn-current/sys/vm/vm_map.c:4226
#10 vm_map_lookup (var_map=0xfffffe00358539e0, vaddr=140737487298560, 
fault_typea=18 '\022', out_entry=0xfffffe00358539e8, 
object=0xfffffe00358539d0, pindex=0xfffffe00358539d8,
    out_prot=0xfffffe0035853a17 "\003", wired=0xfffffe0035853a04) at 
/opt/src/svn-current/sys/vm/vm_map.c:4549
#11 0xffffffff80956702 in vm_fault_hold (map=0xfffff80005757000, 
vaddr=140737487298560, fault_type=2 '\002', fault_flags=0, m_hold=0x0) 
at /opt/src/svn-current/sys/vm/vm_fault.c:589
#12 0xffffffff80956640 in vm_fault (map=0xfffff80005757000, 
vaddr=<optimized out>, fault_type=2 '\002', fault_flags=0) at 
/opt/src/svn-current/sys/vm/vm_fault.c:550
#13 0xffffffff809ade44 in trap_pfault (frame=0xfffffe0035853c00, 
usermode=1) at /opt/src/svn-current/sys/amd64/amd64/trap.c:846
#14 0xffffffff809ad4ab in trap (frame=0xfffffe0035853c00) at 
/opt/src/svn-current/sys/amd64/amd64/trap.c:355
#15 <signal handler called>
#16 0x0000000000215f3e in ?? ()
Backtrace stopped: Cannot access memory at address 0x7fffffefe4b0


-- 
Cheers,
Cy Schubert <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  http://www.FreeBSD.org

	The need of the many outweighs the greed of the few.