From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id CFC4F3938C10 for ; Mon, 7 Jun 2021 20:13:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CFC4F3938C10 Received: by mail-pg1-x52a.google.com with SMTP id t9so14715347pgn.4 for ; Mon, 07 Jun 2021 13:13:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tqDhrsw4wV988BiepHT+5Mqg6fyIotrYvULmo49wb30=; b=RkQzyCEA6vOEP/KNG4YyhgHcd1QfpPHXpWwiWk7/+jUvO48F5lyRbXgq4SPYikeEtu aFim034FguPxZTlY8xgWyrfco4PXwe+TTndiLP19q1KBrq/7hF/fTVXSO3vWXO+VIOoQ hCNqbRcZ3+t3jV7+ym71uZdA+ZlnZUxuX1rnsCGldcuAbEY1C5qd0U3sVPFR/TKLLIEQ 8LUc7cun9pDoVBrFwQEgkXFBYqLBcELx9iztYP+GOn5LgADUFPaHSrG0oXafU5+XKjdc cZE2KCJjjzbz8ugzPBEZ9yA9S6Inq6RhVbzs+VS2BvO1scORIJYuADoV8wx3UUCTkOhd LlRQ== X-Gm-Message-State: AOAM530HVjGFN/06Vv8a+WwdiX56LovWrXz3VgkkyCLl3tyv2PSYA70d MXm6Be/L/ErjzN3ZsM/0iXQZXlA7h8jCvk+wxAs= X-Google-Smtp-Source: ABdhPJwp9LG+8JMsCsni8UaoYl9DxJ0G/aQm6lRBN3AYQIoCLeAHhOSYVH9C8z3NuoPfz0inF156hIG4HiLVP8rnjco= X-Received: by 2002:a62:53c1:0:b029:2ef:25e8:d9e5 with SMTP id h184-20020a6253c10000b02902ef25e8d9e5mr8284555pfb.74.1623096790752; Mon, 07 Jun 2021 13:13:10 -0700 (PDT) MIME-Version: 1.0 References: <20210607083011.855616-1-goldstein.w.n@gmail.com> <8690911e-3cac-836b-2a8a-8b5b2ca74b02@cs.ucla.edu> <2140c229-3a7d-034e-fa2a-03f41084b9c6@cs.ucla.edu> In-Reply-To: <2140c229-3a7d-034e-fa2a-03f41084b9c6@cs.ucla.edu> From: Noah Goldstein Date: Mon, 7 Jun 2021 16:12:59 -0400 Message-ID: Subject: Re: [PATCH v1] x86: memcmp-avx2-movbe.S and memcmp-evex-movbe.S fix overflow bug. To: Paul Eggert Cc: Siddhesh Poyarekar , GNU C Library X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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, 07 Jun 2021 20:13:14 -0000 On Mon, Jun 7, 2021 at 3:51 PM Paul Eggert wrote: > On 6/7/21 11:07 AM, Noah Goldstein wrote: > > What do we want the behavior to be? Generally I would think > > failing silently can be quite painful for users. > > Traditionally we have typically said to go for the best typical-case > performance, and not to worry about how that affects undefined behavior. > That works for me. The old versions are slightly faster / use less code. Panicked a bit last night when I thought I might have pushed a bug :/ > > So, for example, glibc's memcmp ((void *) 1, NULL, 0) does not dump core > even though its behavior is undefined, because it would slow glibc down > to force memcmp to dump core for that case. > > A debugging library like valgrind's might choose to crash more reliably. >