From owner-freebsd-current@freebsd.org Sun Jul 14 19:34:25 2019 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6E89A444C for ; Sun, 14 Jul 2019 19:34:25 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EC968910A for ; Sun, 14 Jul 2019 19:34:25 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io1-xd43.google.com with SMTP id g20so30783481ioc.12 for ; Sun, 14 Jul 2019 12:34:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=k+MSsjwfSD4w470i1Fs7zuMy2VXZE/j/EcPPFIbksuk=; b=po1i1/StN67UJHdLyCAZXO2TVDy9WgVdXbMTSbyjiYU2Ne1YMJvFWIlfOGZ7bxEeMk uED6d/grHYjq2D0m0j3eJf5yATxCHSDLn2H47fdehPIBHdxM2+eRG2ZZlcTRCvs21Hqm +ho2tummfCPFhYRQeIrMd9qhfFisPmpnqrvBme22KELLS+OTjW6FZaHdtPOK72Nfre+B ovnBNO8o351jtUD3XCu2cZYJO2JOjpCY+3i16614wkdUBpibm4CPJB34BaPDanddBUL8 vRdHaG7ngUJr00P8IzK9NONq8ApUauDP5sHq192h9MjZEgYvw2wt8ir0huFgp01RSU7E zt0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=k+MSsjwfSD4w470i1Fs7zuMy2VXZE/j/EcPPFIbksuk=; b=W4son3aat9Yr4HRVcKf1OwmnsVrYW188gJSQ2ER4SLtFyuUB/YsgwkXF2zc88NyFYD YwP2pnmJiqNvI8iOqHPniOZJV0qP8EHhIBTYrSPYNYyhhqM8WVc6CWj7Futhn1vTZqJ0 f73pbQjWOYjRbLkPIqHZh18dFE7pDmb9GhEQgKbL2q6OnQSnW1wbtWhr8Eo25/FF1skE v/z/wZ3Kb4FjtXKHuWrwmhnkpQOpBhimQ1o9d2PolnbcCBsPfY3x16tUUX89BPXwiir2 mmohho/8mmft3corid2gcTgNo/KrmNPJiF1Vd0xLMeq4ZKZhgewhNl7mHlvIxIiIJxJC LW6w== X-Gm-Message-State: APjAAAUmwlDG3ykzzV1Zc999W2x0hJrhLsD9OfdalhcH6ZcpXvPsSnXt qYGxeModkNqrCBogznGPRWUGSQnf X-Google-Smtp-Source: APXvYqx3pWG9MIEUCF7vbcKeti++q1LiUxzhlDZnRrI07NZinOvh3CaTv7coBQmssBRWy/P0MmHEMQ== X-Received: by 2002:a5d:915a:: with SMTP id y26mr21649025ioq.207.1563132863633; Sun, 14 Jul 2019 12:34:23 -0700 (PDT) Received: from raichu (toroon0560w-lp140-05-70-29-85-38.dsl.bell.ca. [70.29.85.38]) by smtp.gmail.com with ESMTPSA id s2sm10768417ioj.8.2019.07.14.12.34.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 14 Jul 2019 12:34:22 -0700 (PDT) Sender: Mark Johnston Date: Sun, 14 Jul 2019 15:34:20 -0400 From: Mark Johnston To: Konstantin Belousov Cc: Larry Rosenman , Freebsd current Subject: Re: panic: vm_page_free_prep: freeing mapped page Message-ID: <20190714193420.GC82719@raichu> References: <20190713221457.GP47193@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190713221457.GP47193@kib.kiev.ua> User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 8EC968910A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-7.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-1.00)[-0.995,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jul 2019 19:34:25 -0000 On Sun, Jul 14, 2019 at 01:14:57AM +0300, Konstantin Belousov wrote: > On Sat, Jul 13, 2019 at 04:50:57PM -0500, Larry Rosenman wrote: > > I have cores. Ideas? > > svn rev: r349976 > > > > [I] ➜ more core.txt.12 > > borg.lerctr.org dumped core - see /var/crash/vmcore.12 > > > > Sat Jul 13 16:47:03 CDT 2019 > > > > FreeBSD borg.lerctr.org 13.0-CURRENT FreeBSD 13.0-CURRENT r349976 > > LER-MINIMAL amd64 > > > > panic: vm_page_free_prep: freeing mapped page 0xfffff82031044790 > > What was the process which caused the panic ? Was it threaded ? I looked at some of the kernel dumps. In all cases the crashing process is postgres. We have: (kgdb) p/x *m->md.pv_list.tqh_first $20 = { pv_va = 0x801c00000, pv_next = { tqe_next = 0xfffff80b3aacb568, tqe_prev = 0xfffff81faf7ecbe8 } } (kgdb) p/x *m->md.pv_list.tqh_first->pv_next.tqe_next $21 = { pv_va = 0x801c00000, pv_next = { tqe_next = 0x0, tqe_prev = 0xfffff80b3ab905d0 } } We can find the corresponding pmaps for these mappings by going through the corresponding pv_chunks. Then I looked up the other processes with mappings of the page. They are also postgres processes. We have: $33 = { prev = 0xfffff818baa2be00, next = 0xfffff80e7e9875b0, left = 0xfffff814df7a6310, right = 0xfffff80e7e9875b0, start = 0x801c00000, end = 0x80aa4a000, next_read = 0x801c00000, max_free = 0x3000, object = { vm_object = 0xfffff80bbeb94400, sub_map = 0xfffff80bbeb94400 }, offset = 0x600000, eflags = 0x0, protection = 0x3, max_protection = 0x7, inheritance = 0x0, read_ahead = 0xf, wired_count = 0x0, cred = 0x0, wiring_thread = 0x0 } and (kgdb) p $33->object.vm_object->ref_count $34 = 0 (kgdb) p $33->object.vm_object->shadow_count $35 = 5 So it seems that there is some problem with vm_object reference counting; I'd expect a vm_map_entry reference to be counted in the ref_count field, and we have at least two such references. Larry, could you open a bugzilla PR for this panic?