From nobody Tue Nov 26 15:52:47 2024 X-Original-To: freebsd-current@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 4XyRtS3mPDz5fdlD for ; Tue, 26 Nov 2024 15:53:04 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic303-24.consmr.mail.gq1.yahoo.com (sonic303-24.consmr.mail.gq1.yahoo.com [98.137.64.205]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4XyRtS0vTGz4kLD for ; Tue, 26 Nov 2024 15:53:04 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1732636381; bh=9W4SS+9c+VUA6jT8z6ziXEi2kIsWjHHqFWnZq/IVqqw=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=dw6HXWIMJGpEo1R2neesRul2nOs/811ouqMiPngtJ+EwrQzUyLP5CYiCKM/XwHmeC33IZJcOQNlxBR6DgQ6AvDXVYmTjS70I7tRSq0T5rt+RPvVtUZdV/2jMf78sEpVfCzWFjePFwBcvdoriBVrW1PbXcp+pa3IeXDtxaDP19aTw2QrPCpRNg1LEGTaextlNIf3davRF6RWx99WQ6JVWx/mZPzWX0oJqOiKL5LS+Ipnaq6diUOiVFMraOieq2FYt731fI9XE/07MeqFHjuO4lknfwIswdhbp2RSTthl/ClVRdpjXvntsICCB3BW5oZ6wGZp5pxeAy8h+AngnecmTtQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1732636381; bh=0mcoOQ84cHq6yZ6dJGtkcSkqCsAcGyPT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JtdaM5YvuZBGtabvMcjMzfVS8y.QqYxieDtaI_r2PLh99bhJhoZKQVTZiE5SEYAG1 7E1gJ8gIjLzaUmnH1WHkIFuc8LN5fKwELvpDrp0ksBkV2l6ZblchkCAYN2AWr_nRWHobytmj0vhZ vWbeW1L2AIKTV.52O3V0cwt04AE.snZiAFsXrG.IML_ij4kwJ1HI8sHXcy56uhgalOeRs0t.b7Vt lERidbT.kHentHCbJ09OdY.HhuNdTgxy_l_6SlTiH8iY.C0gxYnXRoc6_qZ7yyYP8VD8bFgsTiuj e3znxwdzXvRb1tbkifsXprHm9j8h5FiLtPNHc6Y9JSjnGWmyT0H2aJSZhRsB0Nlr42uh0VZ96A5c N8_8Y8.tQw7aDVOYOPjoOPIIjeUXykUUob2YNvGX2QsCaz3uOH7cuU4RjA5XElY_g7cdcEYX0UK4 PNKYKEvwyPmjogD4yI.ouLdv14A3MTgObgCMBq8MkWWpbLI_4VrVUq4Jkdzr.mOPUylmxVqQeyUo Nr1.67WCOM7S_Qcspde1xU0QEosKsYhM1zUZ.9Ik5Y7.3ir12eEWj18X2J5Fs X-Sonic-MF: X-Sonic-ID: 14b2793b-3458-4ee2-acb9-8106e44e98f9 Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Tue, 26 Nov 2024 15:53:01 +0000 Received: by hermes--production-gq1-5dd4b47f46-pfhh2 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 5db59a8d4adc5a7b76cc431e6aaf5eb1; Tue, 26 Nov 2024 15:52:58 +0000 (UTC) Content-Type: text/plain; charset=utf-8 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51.11.1\)) Subject: Re: port binary dumping core on recent head in poudriere [tmpfs corruptions involving blocks of zeros that should not be all zeros] From: Mark Millard In-Reply-To: Date: Tue, 26 Nov 2024 07:52:47 -0800 Cc: Dimitry Andric , =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= , "jah@freebsd.org" , dougm@freebsd.org, Alan Somers , Mark Johnston , FreeBSD Current , Guido Falsi , Yasuhiro Kimura , ports@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <33D56E3E-6476-48E8-B115-B906629B8AF5@yahoo.com> References: <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> <865xoa2t6f.fsf@ltc.des.dev> <69A2E921-F5E3-40D2-977D-0964EE27349A@FreeBSD.org> <4AE5B316-D7EB-4290-8D52-7FBF244EA7A4@FreeBSD.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3776.700.51.11.1) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US] X-Rspamd-Queue-Id: 4XyRtS0vTGz4kLD X-Spamd-Bar: ---- On Nov 26, 2024, at 05:38, Konstantin Belousov wrote: > On Tue, Nov 26, 2024 at 01:58:19PM +0100, Dimitry Andric wrote: >> On 26 Nov 2024, at 13:32, Dimitry Andric wrote: >>>=20 >>> On 26 Nov 2024, at 11:19, Dag-Erling Sm=C3=B8rgrav = wrote: >>>>=20 >>>> Mark Millard writes: >>>>> =46rom 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. >>>>=20 >>>> 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. >>>>=20 >>>> 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. >>>>=20 >>>> 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)`. >>>=20 >>> Yes, tmpfs is indeed the culprit (or at least involved). I have had = USE_TMPFS=3Dlocalbase in my poudriere.conf for a long time, since = otherwise my build machine would run out of memory very quickly, so I = didn't encounter any issues. >>>=20 >>> Now I changed it to USE_TMPFS=3Dyes, rebuilt only textproc/libsass = and textproc/sassc, and then after reinstalling those packages: >>>=20 >>> $ /usr/local/bin/sassc >>> Segmentation fault >>=20 >> And after applying Dag-Erling's patch to disable copy_file_range for = cp and install, it works correctly again. >=20 > So indeed there might be an issue in tmpfs seeking for data. Could = you try > the following? >=20 > commit f4b848946a131dab260b44eab2cfabceb82bee0c > Author: Konstantin Belousov > Date: Tue Nov 26 15:34:56 2024 +0200 >=20 > tmpfs: do not skip pages searching for data >=20 > If the iterator finds invalid page at the requested pindex in > swap_pager_seek_data(), the current code only looks at the swap = blocks > to search for data. This is not correct, valid pages may appear at = the > higher indexes still. >=20 > diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c > index db925f4ae7f6..390b2c10d680 100644 > --- a/sys/vm/swap_pager.c > +++ b/sys/vm/swap_pager.c > @@ -2503,12 +2503,9 @@ swap_pager_seek_data(vm_object_t object, = vm_pindex_t pindex) > VM_OBJECT_ASSERT_RLOCKED(object); > vm_page_iter_init(&pages, object); > m =3D vm_page_iter_lookup_ge(&pages, pindex); > - if (m !=3D NULL) { > - if (!vm_page_any_valid(m)) > - m =3D NULL; > - else if (pages.index =3D=3D pindex) > - return (pages.index); > - } > + if (m !=3D NULL && pages.index =3D=3D pindex) > + return (pages.index); > + > swblk_iter_init_only(&blks, object); > swap_index =3D swap_pager_iter_find_least(&blks, pindex); > if (swap_index =3D=3D pindex) Not sufficient, unfortunately . . . I patched what I've been running and rebooted into: # uname -apKU FreeBSD 7950X3D-ZFS 15.0-CURRENT FreeBSD 15.0-CURRENT #152 = main-n273696-43e045c1733d-dirty: Tue Nov 26 07:21:27 PST 2024 = root@7950X3D-ZFS:/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64= .amd64/sys/GENERIC-NODBG amd64 amd64 1500027 1500027 Note: 43e045c1733d is from 2024-Nov-18 . I then built libsass : [00:00:02] [01] [00:00:00] Building textproc/libsass | libsass-3.6.6 [00:00:20] [01] [00:00:18] Finished textproc/libsass | libsass-3.6.6: = Success ending TMPFS: 3.42 GiB I then installed it, resulting in: # pkg info libsass libsass-3.6.6 Name : libsass Version : 3.6.6 Installed on : Tue Nov 26 07:33:15 2024 PST Origin : textproc/libsass Architecture : FreeBSD:15:amd64 Prefix : /usr/local Categories : textproc Licenses : MIT Maintainer : nivit@FreeBSD.org WWW : https://sass-lang.com/libsass Comment : C/C++ implementation of a Sass compiler Shared Libs provided: libsass.so.1 Annotations : FreeBSD_version: 1500027 build_timestamp: 2024-11-26T15:32:33+0000 built_by : poudriere-git-3.4.99.20240811 . . . libsass.so.1.0.0 still has .got.plt starting with (this time): 2bed60 00000000 00000000 00000000 00000000 ................ 2bed70 00000000 00000000 00000000 00000000 ................ 2bed80 00000000 00000000 00000000 00000000 ................ 2bed90 00000000 00000000 00000000 00000000 ................ . . . 2bffc0 00000000 00000000 00000000 00000000 ................ 2bffd0 00000000 00000000 00000000 00000000 ................ 2bffe0 00000000 00000000 00000000 00000000 ................ 2bfff0 00000000 00000000 00000000 00000000 ................ 2c0000 96cb2a00 00000000 a6cb2a00 00000000 ..*.......*..... 2c0010 b6cb2a00 00000000 c6cb2a00 00000000 ..*.......*..... 2c0020 d6cb2a00 00000000 e6cb2a00 00000000 ..*.......*..... 2c0030 f6cb2a00 00000000 06cc2a00 00000000 ..*.......*..... . . . And still results in: # sassc Segmentation fault (core dumped) =3D=3D=3D Mark Millard marklmi at yahoo.com