From owner-dev-commits-src-all@freebsd.org Thu May 27 21:48:02 2021 Return-Path: Delivered-To: dev-commits-src-all@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 20B58646058; Thu, 27 May 2021 21:48:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FrhJL0VHgz4vDf; Thu, 27 May 2021 21:48:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 7F9FB4F69; Thu, 27 May 2021 21:48:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Kirk McKusick , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202105212038.14LKcb3U062829@gitrepo.freebsd.org> From: John Baldwin Subject: Re: git: f190f9193bc1 - main - Fix fsck_ufs segfaults with gjournal (SU+J) Message-ID: <4faa0667-ca1b-923b-fbae-c97b0b863589@FreeBSD.org> Date: Thu, 27 May 2021 14:47:57 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <202105212038.14LKcb3U062829@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 21:48:02 -0000 On 5/21/21 1:38 PM, Kirk McKusick wrote: > The branch main has been updated by mckusick: > > URL: https://cgit.FreeBSD.org/src/commit/?id=f190f9193bc10a8193c87e0a02fa91400e4eb159 > > commit f190f9193bc10a8193c87e0a02fa91400e4eb159 > Author: Kirk McKusick > AuthorDate: 2021-05-21 20:41:40 +0000 > Commit: Kirk McKusick > CommitDate: 2021-05-21 20:42:37 +0000 > > Fix fsck_ufs segfaults with gjournal (SU+J) > > The segfault was being hit in ckfini() (sbin/fsck_ffs/fsutil.c) > while attempting to traverse the buffer cache to flush dirty buffers. > The tail queue used for the buffer cache was not initialized before > dropping into gjournal_check(). Move the buffer initialization earlier > so that it has been done before calling gjournal_check(). This appears to have broken fsck in at least some use cases. On my rpi I get this error trying to boot: Setting hostid: 0x4ce29432. Starting file system checks: fsck_ufs: Initial malloc(-1515870811) failed fsck_ufs: Initial malloc(-1515870811) failed Automatic file system check failed; help! ERROR: ABORTING BOOT (sending SIGTERM to parent)! The amount being passed to malloc() is malloc junk: (gdb) p/x -1515870811 $1 = 0xa5a5a5a5 The i386 CI jobs in jenkins have been failing with the same error recently as well. I guess this means sblock isn't fully initialized by sblock_init()? At least not enough to set fs_bsize? Hmm, perhaps readsb() is what sets fs_bsize? -- John Baldwin