From nobody Thu Aug 21 04:16:03 2025 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 4c6qkX14vlz65k9X for ; Thu, 21 Aug 2025 04:16:04 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c6qkX0NnRz3YpW for ; Thu, 21 Aug 2025 04:16:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755749764; 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=Xjo5PCGETsRN0Nv7hhPha72F0vOsXF52gdoe7It0Prg=; b=g6RNKn5fWmkg8U0Pn6MKXRWkJe64uGs+upyDizsFbKYHaQKkVlkMPqJ6BF6Zwzfxe4Ph4U 9Sb09H1B1wBOuBekaCKVmvcdrZ2MZs1VIzgEVCALk1cY5YH63xIszitFSBBFhuS5Av6lOR /HiKlsoCqIMz8iH8u8fiO/xGcK8ntWrUDaMmf/ctAuam6dZ3lMxiFtpVmIsbYnFCkJ1vPR We5+e5ZXoICCAtYro/LuLeiKMXjOqgvVuGkOQztJfiHNPQPVQVyYEXECG5lP+T76Tav0ch tWP4X6aMHLId53EQuFIWr7EgnUdf17AIDSENq4tZeeQ63LXiwm+78mv1s6SQUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755749764; 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=Xjo5PCGETsRN0Nv7hhPha72F0vOsXF52gdoe7It0Prg=; b=crYU5DJResRE5+vDxdEEXY1JBCZYWkmpIFNecb2lL/4XfAQ/qWrVkwpQsY/oiD8OotsqAv MGwNtDcDoVJZoR7/0wsWxXuOXIvrEdMTwEUyOaGC4FJZ+hqd2Qz996Vrr0GlTMLFB5bku+ v7DZX2pz++9XHg81IdHTZAyyA38kmjc6OngqIZBfkcKttz3p67ehDotZ0fec0bBKWIAOds Cbzi1pmG/++nJ4j2vYwYGWvHkh7/aXQBhDPXs5ZJKa1i6QFgpeUApYP72iyGyA9yHwlrEG Bh1qG3vTefpvT/6lbLO8pVcqqIK/uNHEdQFHg8Bouy4CdDDbY4mD7arl8SyoGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1755749764; a=rsa-sha256; cv=none; b=HuCIBnlFPG4BMBW8jauvOQY1BXs26kBQmrwpLkXPMgaUvEI0gOf/yKdlI+a+0TWX7ttcZ9 4KsePKfLPA+oGtDyc0GhSBURi3+pwGTntF5Hnq4bEgfNYbve/Uq5g+Hf+GMEGt/Nb4Yq1j XKA9nV8m7C0JuVl2/RmCvECoM1RDVRz2kRjfXxUF43DduZCLPvM6cfWYuU7oSx5Ko0j43y iiUS8pskMbvNrGBlHEV4f2BR2+DEO+wVVv/D9Fcv3LDNpBImAwhw+ZXG6lxSmkrDi4MjCX toYPcwKmlVd6hLBm7bQC/miRBBwmGvCu1L9jj1soKNtzz91nkNlAxvkMBTRvtQ== 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 4c6qkX00PWzk8N for ; Thu, 21 Aug 2025 04:16:04 +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 57L4G3EG068853 for ; Thu, 21 Aug 2025 04:16:03 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 57L4G3F1068852 for bugs@FreeBSD.org; Thu, 21 Aug 2025 04:16:03 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 288985] [regression 14.2] copy_file_range fails to update inoffp and outoffp Date: Thu, 21 Aug 2025 04:16:03 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 14.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: thiago@kde.org 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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" 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=3D288985 Bug ID: 288985 Summary: [regression 14.2] copy_file_range fails to update inoffp and outoffp Product: Base System Version: 14.3-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: thiago@kde.org Ref: https://bugreports.qt.io/browse/QTBUG-138570 Testcase: #include #include #include #include #include int main(int argc, char **argv) { if (argc < 2) { puts("usage: copyfilerangetest src dst"); return 0; } int src =3D open(argv[1], O_RDONLY); int dst =3D open(argv[2], O_WRONLY | O_CREAT, 0777); off_t srcoffset =3D 0; off_t dstoffset =3D 0; ssize_t copied; do { copied =3D copy_file_range(src, &srcoffset, dst, &dstoffset, SSIZE_= MAX, 0); } while (copied < 0); printf("copied %zd bytes (srcoffset now %ld dstoffset now %ld)\n", copied, srcoffset, dstoffset); } Execute: echo hello > foo ./a.out foo bar If you run this on 14.2, it will say "copied 6 bytes (srcoffset now 6 dstof= fset now 6)". If you run this on 14.3, it will say "srcoffset now 0 dstoffset now 0". This broke the Qt implementation which relied on a similar loop to the abov= e to copy a full file, if interruptions might happen: do { copied =3D ::copy_file_range(srcfd, &srcoffset, dstfd, &dstoffset, SSIZE_MAX, 0); } while (copied > 0 || (copied < 0 && errno =3D=3D EINTR)); Because srcoffset =3D 0 on return, we ended up copying the same bytes over = and over again. --=20 You are receiving this mail because: You are the assignee for the bug.=