From nobody Tue Nov 26 10:19:52 2024 X-Original-To: ports@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 4XyJV30Lq0z5fFT5; Tue, 26 Nov 2024 10:19:55 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XyJV26wwGz4nBr; Tue, 26 Nov 2024 10:19:54 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732616395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PINMBuu0iwZzr3F/s3L9g0j4rp08jQ1nqeoc2rsw66M=; b=W7pmLmuGNv6iT3Sefax8D2IqQiI3ClmE0c5ccSSZcW5KH5dNHoABmvWBli+ReoG01Rit50 2oBo/zzgZj4hAGkuMUpHgRVK4tbKqQhIC3Y5+AuQMRzhn6363BkxlTi+lvoqMfHOVuH9Em RJ4zdH0WR73xpqpGNvIz41p6yC26UtUuRniRuNxEFOBHSD0NeigzMei0cQr2UOJIZbYaV9 EPtVWqKSaGaDMk3r6Ww+g7Y5ka5HVugSgMEYQgCZ3M1enl6RLh6JhVvkpgVKFv6ACSYunE uSCHI1vaylukFKGQrTKmz/tWpgM/iqDVVEb88gvUWNKSxq2gRq6KW2A6MEz6rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732616395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PINMBuu0iwZzr3F/s3L9g0j4rp08jQ1nqeoc2rsw66M=; b=g45e1TLeqali2+A8Jl/SUG3V+6zkKzs5Bs1xukDB7MlVxKvRaatWjdOLhM/PnXGPg4VYKI snE2QjUy/mzVzSvMGt4VB7aVHxyvFxRNgnjK4t+126IIW+ZWiOJjYA2nFw2Rk/eixlKI0Y kiDSBP0Ce83kiA5+kIZzye5a00e1V3KLefe4WgO46MvnigDg8mXud6wI6jLenVqe/RB5SA elRSVW50HbI8PqrXCvSPjURwofQfopSFPpP+Q0ZpvmWtVAhdbpsPmWP3/3gnrPW+I2ldhi 06qxPePbXiwNIgUA3gSu61fVlvXY+tX2IUWRGNH/vMgCXz3Cy9w6eE6sxS+MIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732616395; a=rsa-sha256; cv=none; b=gZCYD80x2SGlHtiLMC0kbnZBGPVlV/jpfWX+qay8Y2DG1JaoZQ7+RWVVbKsSYElJWDC4fn u75pRaRjl/IgldAuOQklnRzMSHsEj3fphtchn43BwS7KKlm1484e9qRfG6AruFxIY/8755 LhDb2WJUHQcLzuAcarl7qm73kjx/5mAPkrTwzvVzExqWxcmSrSElhARZlOBgGcJPr2j+j+ Kf2gahDcMMqW8FE0QGTHcOtPy9u8Oitf10Df7/Xm1PJ85mNp5O8eul1/coYLLjoFCepVOF g/ebvlyoVFLZeNBxZ4uCPSlWQI4k2DFVzuXcHqUemq4fDR1FZCk14TCNKbYo9g== Received: from ltc.des.dev (unknown [IPv6:2a01:e0a:c54:bed0:922e:16ff:fef1:acef]) (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) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XyJV25nzlzcxx; Tue, 26 Nov 2024 10:19:54 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 585F86028F; Tue, 26 Nov 2024 11:19:52 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mark Millard Cc: "jah@freebsd.org" , dougm@freebsd.org, asomers@freebsd.org, Mark Johnston , FreeBSD Current , Dimitry Andric , Guido Falsi , Yasuhiro Kimura , ports@freebsd.org Subject: Re: port binary dumping core on recent head in poudriere [tmpfs corruptions involving blocks of zeros that should not be all zeros] In-Reply-To: <3660625A-0EE8-40DA-A248-EC18C734718C@yahoo.com> (Mark Millard's message of "Tue, 26 Nov 2024 00:21:40 -0800") References: <7c9c3cf5-bbd1-4642-8d04-33aa07a4db02@madpilot.net> <9df256a8-c6ed-46d9-b955-fc2657c12d36@madpilot.net> <5c502054-7353-4a1e-8350-c403482e9c0d@madpilot.net> <3127C3BA-FC93-4636-ADDB-89518DE9C60D@FreeBSD.org> <86ed2zsp6l.fsf@ltc.des.dev> <5f24a570-26e0-4c0a-817f-591a234fd07b@madpilot.net> <5918C6A1-8FDB-40CA-8C86-EB7B7BE75A2E@yahoo.com> <86ed2zc8r5.fsf@ltc.des.dev> <45098ccf-4dc6-426c-849a-c923805d6723@madpilot.net> <38658C0D-CA33-4010-BBE1-E68D253A3DF7@FreeBSD.org> <1004a753-9a3c-4aa2-bfa8-4a0c471fe3ea@madpilot.net> <0690CFB1-6A6D-4B63-916C-BAB7F6256000@yahoo.com> <3660625A-0EE8-40DA-A248-EC18C734718C@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Tue, 26 Nov 2024 11:19:52 +0100 Message-ID: <865xoa2t6f.fsf@ltc.des.dev> List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-ports@freebsd.org Sender: owner-freebsd-ports@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mark Millard writes: > From inside a bulk -i where I did a manual make command > after it built and installed libsass.so.1.0.0 . The > manual make produced a /wrkdirs/ : > [...] > So the original creation looks okay. But . . . > [...] > So: The later, staged copy is a bad copy. Both are in the > tmpfs. So copying to the staging area makes a corrupted > copy inside the same tmpfs. After that, further copies of > staging's bad copy can be expected to be messed up. This and the fact that it happens on 14 and 15 but not on 13 strongly suggests an issue wth `copy_file_range(2)`, since `install(1)` in 14 and 15 (but not in 13) now uses `copy_file_range(2)` if at all possible. My educated guess is that hole detection doesn't work reliably for files that have had holes filled while memory-mapped, so `copy_file_range(2)` thinks there is a hole where there isn't one and skips some of the data when `install(1)` uses it to copy the library from `${WRKSRC}` to `${STAGEDIR}`. This may or may not be specific to tmpfs. You may want to try applying the attached patch to your FreeBSD 14 and 15 jails. It prevents `cp(1)` and `install(1)` from trying to use `copy_file_range(2)`. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-cp-install-disable-copy_file_range.patch >From 18eb75139045c30609d93f6a138526d3288acbd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Tue, 26 Nov 2024 10:54:14 +0100 Subject: [PATCH] cp, install: disable copy_file_range. --- bin/cp/utils.c | 2 +- usr.bin/xinstall/xinstall.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/cp/utils.c b/bin/cp/utils.c index cfbb2022caaf..c6a688235bf1 100644 --- a/bin/cp/utils.c +++ b/bin/cp/utils.c @@ -104,7 +104,7 @@ copy_file(const FTSENT *entp, int dne) ssize_t wcount; off_t wtotal; int ch, checkch, from_fd, rval, to_fd; - int use_copy_file_range = 1; + int use_copy_file_range = 0; fs = entp->fts_statp; from_fd = to_fd = -1; diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index 2823a9040b7a..4ab0a6dd0de2 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -1194,6 +1194,7 @@ copy(int from_fd, const char *from_name, int to_fd, const char *to_name, err(EX_OSERR, "lseek: %s", to_name); #ifndef BOOTSTRAP_XINSTALL +#if 0 /* Try copy_file_range() if no digest is requested */ if (digesttype == DIGEST_NONE) { do { @@ -1210,6 +1211,7 @@ copy(int from_fd, const char *from_name, int to_fd, const char *to_name, } /* Fall back */ } +#endif #endif digest_init(&ctx); -- 2.46.0 --=-=-=--