From owner-freebsd-hackers@freebsd.org Fri Feb 12 20:21:59 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D638BAA7D4E for ; Fri, 12 Feb 2016 20:21:59 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ob0-x229.google.com (mail-ob0-x229.google.com [IPv6:2607:f8b0:4003:c01::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A838115B1 for ; Fri, 12 Feb 2016 20:21:59 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ob0-x229.google.com with SMTP id is5so136358908obc.0 for ; Fri, 12 Feb 2016 12:21:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=HLuzFLVT/divY/UuDvPv6gvlro9UX8gOPiYpznR+mM8=; b=VeawCux+cSuO8A9+gy1fdUQ3LaKClQYoGrBjQKiobhGfj7J/y1ZQU0ybIvjlGBWtQx OUnlZZiFPknu0OfmGv67sN4IKSeg7HSr1KFktssz4GwheSYuEdqpn9xhnGlDHVmxj3aH EaWqA7j4kvKOBn78MBpJjumSUc9/8ywEgEy/JTPFT3vKfcjIfeP+1Gq5iNgRCxoVJgaS GPTBtUwSe5+DUKyXi/KH1qdX43X/RRuz2NtIxYg2FCLmHNkxNWzCWxr+m/DAnrChmn6k eQD3gzVtTxLXhcRkYQ2DWpPs23/jz2WKfOkqH75iUrgb/iQ0sxMktZ2tYJ6tPq7AHw0M wlKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:date:message-id:subject:from :to:content-type; bh=HLuzFLVT/divY/UuDvPv6gvlro9UX8gOPiYpznR+mM8=; b=RtPQmjmQQYnO7kl7Tk4evdcYGqrkhGGIcbVzjEY+amEp/MLkkU5N5w1L3AmwDwThvp d4OHJ3PLEZQ7c8AtWtG1OWoYsjySYFTLsPRcrCQbKwrCbh2yN988CSZBuR4Y1s1/VN8p Ff4Y6QCU30okTHKU/i2M/7lSOmklSTobhnhb/jQUj5vY3c2qIe3YRNZXnyDGtYcbTumh sFyyRCHIRjHY7CuKJvR+Qi7lPAIvKxDEU96najHyX5wvgqP19VKAvJtMBms19nYw6uM4 HDsqXI6liBTZwRqXBPZ1v+RcDGaWPjdbVvWNFxHSl0BS98GxLEEVcnuAZC9+VlYpHTiW 1cxw== X-Gm-Message-State: AG10YOSGWm7ZprHcmX6NHJlJgdm+OOhMPwb4F6Pn1o3S6cXyW06c0NMp1NcvTJq3eOpuQrpUkiGJjlvUmG4Nyw== MIME-Version: 1.0 X-Received: by 10.182.63.42 with SMTP id d10mr2870673obs.65.1455308518533; Fri, 12 Feb 2016 12:21:58 -0800 (PST) Sender: asomers@gmail.com Received: by 10.202.78.83 with HTTP; Fri, 12 Feb 2016 12:21:58 -0800 (PST) Date: Fri, 12 Feb 2016 13:21:58 -0700 X-Google-Sender-Auth: 4XP61skx7-pvxK0HdfM-3gBHIkg Message-ID: Subject: Page faults in getnewvnode with memguard(9) enabled From: Alan Somers To: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2016 20:21:59 -0000 Prospecting for memory errors in ZFS, I tried running the ZFS test suite with memguard enabled. But as soon as I enable it, I hit the following panic within a few seconds. Line 1350 of vfs_subr.c simply accesses an object that was just allocated. I can't see anything wrong with the code, so I suspect a bug in memguard. Has anybody successfully used memguard on recent kernels? My memguard setting is "vm.memguard.frequency=100", so all memory allocations will be protected with a probability of 0.1%. If instead I leave vm.memguard.frequency=0 and set vm.memguard.desc=solaris, I don't hit this panic. I wonder if certain uma zones need to be off-limits to memguard's protection. #1 0xffffffff8038a6cb in db_dump (dummy=, dummy2=false, dummy3=0, dummy4=0x0) at /usr/home/alans/freebsd/head/sys/ddb/db_command.c:533 #2 0xffffffff8038a4be in db_command (cmd_table=0x0) at /usr/home/alans/freebsd/head/sys/ddb/db_command.c:440 #3 0xffffffff8038a254 in db_command_loop () at /usr/home/alans/freebsd/head/sys/ddb/db_command.c:493 #4 0xffffffff8038cd5b in db_trap (type=, code=0) at /usr/home/alans/freebsd/head/sys/ddb/db_main.c:251 #5 0xffffffff80ae34c3 in kdb_trap (type=12, code=0, tf=) at /usr/home/alans/freebsd/head/sys/kern/subr_kdb.c:654 #6 0xffffffff80f38731 in trap_fatal (frame=0xfffffe20b3d1c090, eva=) at /usr/home/alans/freebsd/head/sys/amd64/amd64/trap.c:836 #7 0xffffffff80f38964 in trap_pfault (frame=0xfffffe20b3d1c090, usermode=) at /usr/home/alans/freebsd/head/sys/amd64/amd64/trap.c:691 #8 0xffffffff80f380fe in trap (frame=0xfffffe20b3d1c090) at /usr/home/alans/freebsd/head/sys/amd64/amd64/trap.c:442 #9 0xffffffff80f1b697 in calltrap () at /usr/home/alans/freebsd/head/sys/amd64/amd64/exception.S:234 #10 0xffffffff80b59404 in getnewvnode (tag=0xffffffff821df2a0 "zfs", mp=0xfffff80044649cc0, vops=0xffffffff821f1600, vpp=0xfffffe20b3d1c320) at /usr/home/alans/freebsd/head/sys/kern/vfs_subr.c:1350 #11 0xffffffff8213f49a in zfs_znode_alloc (zfsvfs=0xfffff8004e187000, db=0xfffff8018fbb0ca8, blksz=0, obj_type=DMU_OT_SA, hdl=0xfffff801256f5770) at /usr/home/alans/freebsd/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c:630 #12 0xffffffff8213f30f in zfs_mknode (dzp=, vap=0xfffffe20b3d1c9d0, tx=0xfffff8012595a700, cr=0xfffff80044582400, flag=, zpp=0xfffffe20b3d1c840, acl_ids=0xfffffe20b3d1c808) at /usr/home/alans/freebsd/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c:989 #13 0xffffffff8217655a in zfs_freebsd_mkdir (ap=) at /usr/home/alans/freebsd/head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c:2284 #14 0xffffffff8108f076 in VOP_MKDIR_APV (vop=, a=) at vnode_if.c:1607 #15 0xffffffff80b6a5b9 in kern_mkdirat (td=, fd=, path=0x8023176c0
, segflg=UIO_USERSPACE, mode=) at vnode_if.h:665 #16 0xffffffff80f39108 in amd64_syscall (td=0xfffff8012537d9a0, traced=0) at subr_syscall.c:135 #17 0xffffffff80f1b97b in Xfast_syscall () at /usr/home/alans/freebsd/head/sys/amd64/amd64/exception.S:394 #18 0x0000000801a61dba in ?? () Previous frame inner to this frame (corrupt stack?) -Alan