From nobody Fri Aug 18 03:40:31 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 4RRnhJ1GGjz4qZct for ; Fri, 18 Aug 2023 03:40:32 +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 4RRnhJ04sqz3b25 for ; Fri, 18 Aug 2023 03:40:32 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692330032; 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=nWxmdAJ1PqqYT20FErFNg29F61SRYxEvg19GgL0Uupg=; b=D5nSimsmX443x1BEJ/NL8VYSL6DCgcJJra22EqzZwpQqAV8x9Vg2lO6bTyz2cldM2JPgKT TjIfJSSPOgGN9bDf9GJew+cJk8RnMSgK/sqao4EXn+nDxmBoDZUxaK7nGEEvc2n9X1it6Q q5sjR+AvGhMzz3zKTu24u7ucm0WX2OUAfEPTL6X8DHrLRh3RqNvOE6WPSQrtYi4+Dk2YUc otYzMwDfpBaFXmspOmjx+GkupzK4bYhSkAFaeIxCN7jhxtx3ECtVDb19uJO4Og22WFwJwS dFGfssWKF4k7AMJx9hOywRz5FY3VS4wrMsRQUif47TgOmcHRb/4l1q7xgFhgDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692330032; a=rsa-sha256; cv=none; b=QrKfyl8KFLWlHWsX7Nj+jicpTy3CHpNUJX/04x/PCk8jmzWu9eMAdIb6vbbk5CnotIzzMH QG2OePbwT13UOSYcp7MP4AyRIhJibBl2Jlr1ZJ3CjUrdQCKtVYOqjaV5BykxT10Z9YxM5i NWeCO9hvlK8zYyOhEifBiYlVLdOZXxZADqdCssvjFGLywuS1E0K0wkYFLy+4E+XFAD1awe MuagQ94rpK2Q+TAizMAQra+pqcX96uQPHuIJeEnugyP0tJMFocguaht4I+Z5rFY8Pvmqxu ikMUdeivOU49ioFjAWcHH1+zto3hyfduuz3LAGoqKu4VHZPXy4f9c8ETHB7Fyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RRnhH5t48z112r for ; Fri, 18 Aug 2023 03:40:31 +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 37I3eVJm079478 for ; Fri, 18 Aug 2023 03:40:31 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 37I3eVCY079477 for bugs@FreeBSD.org; Fri, 18 Aug 2023 03:40:31 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 273192] [PATCH] Distextract tries to divide by 0 Date: Fri, 18 Aug 2023 03:40:31 +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: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: lars@oddbit.com 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 attachments.created 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=3D273192 Bug ID: 273192 Summary: [PATCH] Distextract tries to divide by 0 Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: lars@oddbit.com Created attachment 244181 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D244181&action= =3Dedit Patch to prevent floating point exception in distextract In the file ./usr.sbin/bsdinstall/distextract/distextract.c, we find: /* Calculate [overall] percentage of completion (if possible) */ if (file->size >=3D 0) return (file->read * 100 / file->size); else return (-1); That conditional is incorrect; if distextract encounters a zero-length file= , it will attempt to divide by file->size, which is 0, which will cause distextr= act fail error out with: Floating point exception (core dumped) The attached patch prevents this error. Addendum: I'm unclear why we use distextract. The "script" automated install script already includes an alternate code path that uses tar if the install isn't running on a tty; if we used this in all cases we could completely dr= op distextract. --=20 You are receiving this mail because: You are the assignee for the bug.=