From nobody Tue Oct 10 20:36:43 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S4nkN3d2Tz4wJ3x for ; Tue, 10 Oct 2023 20:36:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S4nkM6gjJz3X2B for ; Tue, 10 Oct 2023 20:36:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696970204; a=rsa-sha256; cv=none; b=Pqg30xQfqM0e1SBKPN9baCqniphQxo0yE2hn152hlz94hGwW5VlHlEn3XDomKZhLxtHk1B W+BROensNdFGVRdyu5NmXBNCo/i4kNRQ8fhzyug4ksdapmwBpl5t6B+leq8iQwfnoRn5v3 95vEAJ4SGw99X22E7/fKnBT4TWBEMCuQgv268B7zOm+EWOK1byAOJFF7I4TucTai0lp70z PmOs6Sn6mYkig8yuFGBhCi57dKbsAGRSKC9UHo9y+TDY53dpRyv0B5XRny4ija93KRGPmS Xy+Uf1oQegpp6yUHCBWgiDGeYgek7N9B6X0MBsVlp0JHCcLZpintXREHU/9r8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696970204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yBW68sg5sp6OZ7rz+AxH+N9w6/iIrHyQOrzi5E8kiP8=; b=R+fi+NwIwPg89pLpIN3y1cn1C8elrUZY0BrgU5GqFs5ue/pe1/TzY4ZkMy8rp+Oy5FFnoD p3ADKjp4m6q140fIjFSy3ELhWJogmrAbil+4KQcZHO6gn0MNiFjmPv5ERAnZeYKA/0Ag0t jz2eYKnkSUF011+e6iYkRAMMjXVm3Ejrg1fIKxe1T9vSEboVD1lvkWpR21ZcnuNtMpz6n9 yyX70jslGAABLMMVXYGuv2oqIf00Hza3XgS/vAtt7QhrKS5FG72PpVS07Q10yxvE5bBgZu EkO8rR0HiT1cBBFxxpxmOwiMbN+UgEMlGaukGP5Yv4TXttg/K9M+3zxHL/5iMQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S4nkM59fNztC4 for ; Tue, 10 Oct 2023 20:36:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 39AKahPk085966 for ; Tue, 10 Oct 2023 20:36:43 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 39AKahF3085965 for bugs@FreeBSD.org; Tue, 10 Oct 2023 20:36:43 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 274404] fsck_ffs(8): Segmentation fault Date: Tue, 10 Oct 2023 20:36:43 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: andreas.bock@virtual-arts-software.de X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D274404 Bug ID: 274404 Summary: fsck_ffs(8): Segmentation fault Product: Base System Version: 13.2-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: andreas.bock@virtual-arts-software.de uname -srmpK FreeBSD 13.2-RELEASE-p2 amd64 amd64 1302001 After a problem with a hard disk drive or the controller (SAS2008 via mps) = it was necessary to power off the machine. When the machine ran again, I performed a file system (UFS2) check with fsck_ffs. The following was executed as a non-root user: fsck_ffs -d /dev/ufsid/5ba7d4b60a5f1bc2 ** /dev/ufsid/5ba7d4b60a5f1bc2 (NO WRITE) bad size: blk 1087831824, offset 0, size 15 Segmentation fault Again, but with GDB: gdb fsck_ffs GNU gdb (GDB) 13.1 [GDB v13.1 for FreeBSD] Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-portbld-freebsd13.1". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from fsck_ffs... Reading symbols from /usr/lib/debug//sbin/fsck_ffs.debug... (gdb) run -d /dev/ufsid/5ba7d4b60a5f1bc2 Starting program: /sbin/fsck_ffs -d /dev/ufsid/5ba7d4b60a5f1bc2 warning: Could not load shared library symbols for [vdso]. Do you need "set solib-search-path" or "set sysroot"? ** /dev/ufsid/5ba7d4b60a5f1bc2 (NO WRITE) bad size: blk 1087831824, offset 0, size 15 Program received signal SIGSEGV, Segmentation fault. Address not mapped to object. 0x000000000103aba9 in checksnapinfo (snapip=3D0x7fffffffe2c8) at /usr/src/sbin/fsck_ffs/setup.c:332 332 /usr/src/sbin/fsck_ffs/setup.c: No such file or directory. I made this change: diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c index f06424558cf4..a67707c08c26 100644 --- a/sbin/fsck_ffs/setup.c +++ b/sbin/fsck_ffs/setup.c @@ -319,6 +319,8 @@ checksnapinfo(struct inode *snapip) size =3D fragroundup(fs, DIP(snapip->i_dp, di_size) - lblktosize(fs, lbn)); bp =3D getdatablk(idesc.id_parent, size, BT_DATA); + if (bp->b_errs !=3D 0) + return (0); snapblklist =3D (daddr_t *)bp->b_un.b_buf; /* * snapblklist[0] is the size of the list Executed again with the now changed fsck_ffs: fsck_ffs -d /dev/ufsid/5ba7d4b60a5f1bc2 ** /dev/ufsid/5ba7d4b60a5f1bc2 (NO WRITE) bad size: blk 1087831824, offset 0, size 15 Removing non-snapshot inode 4 from snapshot list SETTING DIRTY FLAG IN READ_ONLY MODE UNEXPECTED SOFT UPDATE INCONSISTENCY ** Last Mounted on /data ** Phase 1 - Check Blocks and Sizes INCORRECT BLOCK COUNT I=3D4 (2874176 should be 2877376) CORRECT? no INCORRECT BLOCK COUNT I=3D103459176 (8 should be 0) CORRECT? no Many problems where successfully repaired during this fsck_ffs run. I don't know if the patch does the correct handling of this situation. After a few completed runs with the unpatched fsck_ffs, the file system sho= ws no signs of problems. --=20 You are receiving this mail because: You are the assignee for the bug.=