From nobody Thu Sep 9 13:54:53 2021 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 4382417B4724 for ; Thu, 9 Sep 2021 13:54:53 +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 4H50qx1K1tz3tWC for ; Thu, 9 Sep 2021 13:54:53 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 083CC1A653 for ; Thu, 9 Sep 2021 13:54:53 +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 189Dsq85097614 for ; Thu, 9 Sep 2021 13:54:52 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 189Dsqt7097613 for bugs@FreeBSD.org; Thu, 9 Sep 2021 13:54:52 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 258387] fetch -v displays bogus data Date: Thu, 09 Sep 2021 13:54:53 +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: se@FreeBSD.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-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 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258387 Bug ID: 258387 Summary: fetch -v displays bogus data Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: se@FreeBSD.org The error output of "fetch -v" should be server messages, but it appears th= at the buffer gets overwritten with data of unknown origin (mostly NUL bytes), e.g.: $ fetch -v http://distcache.us-west.freebsd.org/x 2>&1 | hd 00000000 72 65 73 6f 6c 76 69 6e 67 20 73 65 72 76 65 72 |resolving serv= er| 00000010 20 61 64 64 72 65 73 73 3a 20 64 69 73 74 63 61 | address: dist= ca| 00000020 63 68 65 2e 75 73 2d 77 65 73 74 2e 66 72 65 65 |che.us-west.fr= ee| 00000030 62 73 64 2e 6f 72 67 3a 38 30 0a 72 65 71 75 65 |bsd.org:80.req= ue| 00000040 73 74 69 6e 67 20 68 74 74 70 3a 2f 2f 64 69 73 |sting http://d= is| 00000050 74 63 61 63 68 65 2e 75 73 2d 77 65 73 74 2e 66 |tcache.us-west= .f| 00000060 72 65 65 62 73 64 2e 6f 72 67 2f 78 0a 0d 0a 00 |reebsd.org/x..= ..| 00000070 67 69 6e 78 00 00 00 0a 34 30 34 20 4e 6f 74 20 |ginx....404 No= t | 00000080 46 6f 75 6e 64 0d 0a 00 00 00 00 00 10 02 00 50 |Found.........= .P| 00000090 95 14 01 c9 00 00 00 00 00 00 00 00 0a 0d 0a 00 |..............= ..| 000000a0 74 6c 65 3e 34 30 34 20 4e 6f 74 20 46 6f 75 6e |tle>404 Not Fo= un| 000000b0 64 0d 0a 00 00 00 00 00 10 02 00 50 95 14 01 c9 |d..........P..= ..| 000000c0 00 00 00 00 00 00 00 00 0a 34 30 34 20 4e 6f 74 |.........404 N= ot| 000000d0 20 46 6f 75 6e 64 0d 0a 00 0a 00 00 00 00 00 10 | Found........= ..| 000000e0 02 00 50 95 14 01 c9 00 00 00 00 00 00 00 00 0a |..P...........= ..| 000000f0 6e 67 69 6e 78 0d 0a 00 3e 0d 0a 00 0a 00 00 00 |nginx...>.....= ..| 00000100 00 00 10 02 00 50 95 14 01 c9 00 00 00 00 00 00 |.....P........= ..| 00000110 00 00 0a 0d 0a 00 72 3e 6e 67 69 6e 78 0d 0a 00 |......r>nginx.= ..| 00000120 3e 0d 0a 00 0a 00 00 00 00 00 10 02 00 50 95 14 |>............P= ..| 00000130 01 c9 00 00 00 00 00 00 00 00 0a 0d 0a 00 72 3e |..............= r>| 00000140 6e 67 69 6e 78 0d 0a 00 3e 0d 0a 00 0a 00 00 00 |nginx...>.....= ..| 00000150 00 00 10 02 00 50 95 14 01 c9 00 00 00 00 00 00 |.....P........= ..| 00000160 00 00 0a 66 65 74 63 68 3a 20 68 74 74 70 3a 2f |...fetch: http= :/| 00000170 2f 64 69 73 74 63 61 63 68 65 2e 75 73 2d 77 65 |/distcache.us-= we| 00000180 73 74 2e 66 72 65 65 62 73 64 2e 6f 72 67 2f 78 |st.freebsd.org= /x| 00000190 3a 20 4e 6f 74 20 46 6f 75 6e 64 0a |: Not Found.| 0000019c The expected output is returned by wget, e.g.: $ wget -d http://distcache.us-west.freebsd.org/x [...] 404 Not Found Registered socket 3 for persistent reuse. Skipping 146 bytes of body: [ 404 Not Found

404 Not Found


nginx
] done. 2021-09-09 15:37:02 ERROR 404: Not Found. Part of the HTML response can be found in the fetch output, too: "r>nginx" is obviously a fragment of "
nginx
", but "r>nginx" appears twice, 40 bytes apart. "tle>404 Not Found" is a fragment of "404 Not Found", with "= 404 Not Found" appearing a total of 3 times ... This could be a result of recent changes to the memcpy function, which used= to allow overlapping buffers, but does not anymore on -CURRENT. But the 4 occurences of memcpy() in libfetch/http.c and libfetch/common.c s= eem to be sane, and I did not look any further for the source of the data corruption. --=20 You are receiving this mail because: You are the assignee for the bug.=