From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id B1CB33835C1E for ; Mon, 10 Jan 2022 21:38:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B1CB33835C1E Received: by mail-pj1-x1029.google.com with SMTP id rj2-20020a17090b3e8200b001b1944bad25so2057758pjb.5 for ; Mon, 10 Jan 2022 13:38:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cR8bXGE/ZA8PhwdqtVex3A5SlptkOZczKPzLnJx1YOY=; b=rjaDkaJCusT9oYJEg4f511SS4SQE7jBDGpjSCIHcZM9zwnd5+Xxs0t2YA3nCIpkhfE u8KRo8SW1OoRs7DlM0zXPY/04uFtfN/K/GkfP476resFcW7WeqqSRDR5BoDIpaC5ZkG8 Aqrf9X7qJ1/A9tQ1FG5DPeGWWKRywTrBH9mjMyeaCI3nT6TiVIwk1j6/aU+uRPZukOph YeYWpg+5uATYt96ObrYb639WkLK5/OSwwmu9fmSH+mrPKGBByF2lNOezPm60u3h9/xnE IIZk00Bzx3PPjkvT+r6d4sUpfFnqVC/hAOEdMkEI9DhNeuCqrW6N2/FslYHap9LLeeZV HJog== X-Gm-Message-State: AOAM5304lhPCGEmTnrgZtVryEZzAhNx6s834V2qu0a5WdC/0a76PJ8MJ ssAA13Ax8tlayTwSsOp6hoXNOlpG3ACuOXdL+0h6Rm7M X-Google-Smtp-Source: ABdhPJxY6pNw8ZHELI8USQfeZmg05wKvX9i9327yFR7kdYMULc65W31aMp6LSLifAg7X0nr6tTGTvdo2MFweTM7YN8o= X-Received: by 2002:a17:903:2486:b0:149:1ce1:d45d with SMTP id p6-20020a170903248600b001491ce1d45dmr1527349plw.57.1641850698903; Mon, 10 Jan 2022 13:38:18 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Noah Goldstein Date: Mon, 10 Jan 2022 15:38:08 -0600 Message-ID: Subject: Re: [PATCH v2 3/7] string/test-str*cmp: remove stupid_[strcmp, strncmp, wcscmp, wcsncmp]. To: Wilco Dijkstra Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jan 2022 21:38:21 -0000 On Mon, Jan 10, 2022 at 5:42 AM Wilco Dijkstra wrote: > > Hi Noah, > > > These implementations are incorrect. There may be a mismatch in s1/s2 > > before invalid memory but no null CHAR / length boundary. > > This is not true, see eg. https://en.cppreference.com/w/cpp/string/byte/strcmp. > Most string functions require that the string is correctly terminated. There > are only a few exceptions (memchr IIRC), and several generic implementations > use strlen or strnlen before the main loop. > > So if your changes to the testsuite cause these functions to fail, I believe it will > create failures on other targets too (eg. AArch64 strcmp does a check for zero > and continues reading if there is no zero). > > It's OK to remove these weirdly named functions (I already removed them from > the benchtests directory), however we should ensure the strings are valid to > avoid reporting errors on existing implementations. Changed the commit message and updated tests so that a valid null terminator is guaranteed for all strings. Thanks for pointing this out. > > Cheers, > Wilco