From nobody Sun Sep 10 13:36:26 2023 X-Original-To: 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 4Rk9qM1BVHz4sXRX for ; Sun, 10 Sep 2023 13:36:31 +0000 (UTC) (envelope-from fuz@fuz.su) Received: from fuz.su (fuz.su [IPv6:2001:41d0:8:e508::1]) (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 (2048 bits) client-digest SHA256) (Client CN "fuz.su", Issuer "fuz.su" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rk9qL586qz3Tvl for ; Sun, 10 Sep 2023 13:36:30 +0000 (UTC) (envelope-from fuz@fuz.su) Authentication-Results: mx1.freebsd.org; none Received: from fuz.su (localhost [127.0.0.1]) by fuz.su (8.16.1/8.16.1) with ESMTPS id 38ADaRKU020176 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 10 Sep 2023 15:36:27 +0200 (CEST) (envelope-from fuz@fuz.su) Received: (from fuz@localhost) by fuz.su (8.16.1/8.16.1/Submit) id 38ADaQnE020175; Sun, 10 Sep 2023 15:36:26 +0200 (CEST) (envelope-from fuz) Date: Sun, 10 Sep 2023 15:36:26 +0200 From: Robert Clausecker To: Warner Losh Cc: FreeBSD Current Subject: Re: sed in CURRENT fails in textproc/jq Message-ID: References: <30a59ac0-28fd-f6ed-505c-9ef6d8e84fc3@tsoft.com> <86edj7qnia.fsf@ltc.des.no> 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 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spamd-Bar: ---- 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:16276, ipnet:2001:41d0::/32, country:FR] X-Rspamd-Queue-Id: 4Rk9qL586qz3Tvl Hi Warner, I have pushed a fix. It should hopefully address those failing tests. The same issue should also affect memcmp(), but unlike for memchr(), it is illegal to pass a length to memcmp() that extends past the actual end of the buffer as memcmp() is permitted to examine the whole buffer regardless of where the first mismatch is. I am considering a change to improve the behaviour of memcmp() on such errorneous inputs. There are two options: (a) I could change memcmp() the same way I fixed memchr() and have implausible buffer lengths behave as if the buffer goes to the end of the address space or (b) I could change memcmp() to crash loudly if it detects such a case. I could also (c) leave memcmp() as is. Which of these three choices is preferable? Yours, Robert Clausecker Am Sun, Sep 10, 2023 at 05:51:43AM -0600 schrieb Warner Losh: > On Sat, Sep 9, 2023, 10:51 PM Robert Clausecker wrote: > > > Greetings, > > > > I apologise for the inconvenience. The issue seems to boil down to > > various places calling > > > > memchr(buf, c, SIZE_MAX); > > > > which causes an overflow when my newly written memchr() computes buf + > > len to find the end of the buffer. A patch to alleviate this issue can > > be found here: > > > > > > http://fuz.su/~fuz/freebsd/0001-lib-libc-amd64-string-memchr.S-fix-behaviour-with-ov.patch > > > > Please check if it does the trick for you. If yes, I'll go ahead and > > push it tomorrow-ish. > > > > > There are half a dozen or do kyua tests that are likely failing because of > this or other reasons related to strings. When you push this fix you'll > get the list. They are hidden among about 80 or so networking tests that > fail. I plan on disabling those tests soon If no one fixes them. > > Warner > > > > > Yours, > > Robert Clausecker > > > > Am Sat, Sep 09, 2023 at 07:12:29PM +0200 schrieb Dag-Erling Smørgrav: > > > Antoine Brodin writes: > > > > Yuri writes: > > > > > Either something has changed in sed(1) in CURRENT, or sed just fails > > > > > during the configure stage of textproc/jq: > > > > > > > > > > sed: No error: 0 > > > > > checking for sys/cygwin.h... eval: ${+...}: Bad substitution > > > > This seems to be a recent issue (less than 5 days). > > > > Hundreds of configure scripts now fail to run on 15-current due to > > > > this sed failure: [...] > > > > > > Try adding ARCHLEVEL=scalar to CONFIGURE_ENV on one of these. If that > > > helps, yell at fuz@ :) > > > > > > DES > > > -- > > > Dag-Erling Smørgrav - des@FreeBSD.org > > > > > > > -- > > () ascii ribbon campaign - for an 8-bit clean world > > /\ - against html email - against proprietary attachments > > > > -- () ascii ribbon campaign - for an 8-bit clean world /\ - against html email - against proprietary attachments