From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 300A41F487 for ; Sun, 29 Mar 2020 21:10:02 +0000 (UTC) Received: from localhost ([::1]:41704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIfBx-0003nl-DB for normalperson@yhbt.net; Sun, 29 Mar 2020 17:10:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49332) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIfBt-0003nQ-RJ for bug-gnulib@gnu.org; Sun, 29 Mar 2020 17:09:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIfBs-0001Uf-So for bug-gnulib@gnu.org; Sun, 29 Mar 2020 17:09:57 -0400 Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]:43179) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jIfBs-0001U5-Mf for bug-gnulib@gnu.org; Sun, 29 Mar 2020 17:09:56 -0400 Received: by mail-il1-x130.google.com with SMTP id g15so13881460ilj.10 for ; Sun, 29 Mar 2020 14:09:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=8wmfjHp9jWAKn6qODSHQl/14e8a5cg5qDGa5tJFuafI=; b=M/wjq4YiN3oUUEzuzOWbqoIXHZLnSfJePsSz+MBDLoKZ2bHAwq5EIkKSVPcEPswwpN 3nph8J4uiA4FI4wZIv9yEkcu+ArPtaHhcmmnH+qB9QEbwy5Od5VLgm3KvFe1cAsi7IUv Bs5bdNnEq50fmpUL7cvXves7sMuQFJ4SHHxdxAnyKz+eez8OrIKotOlx6rOrvMnMRE/g tuSqNwywamJkL7PJb/XVoevnTCSfMrgnMgTgDhyV2K+hPBZkum03BYIg/Jh53Z9bbbQL DyPtLuxyD36aNKmvcDYjWfF56gpVzIfiYuVfracO/C0ip4IBOc+TjVQsW/OeifUXnQZ6 X6FA== 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:reply-to :from:date:message-id:subject:to:cc; bh=8wmfjHp9jWAKn6qODSHQl/14e8a5cg5qDGa5tJFuafI=; b=SDkORa84oT2zbhm2jF/FGp0u0QPSI+zeKlyaVQUBzDND+a8Slc6LzUBSLKF/syXzWf RlQroT2MCf459IL+w1se78VOVvE7cShck/fat6IY5jgT7jbish0AR9+1SR9JY/reEZKv tZi/AAPGv3qAB+GZ+pYxpmKB/EKz8AKlxPd/csZQkSCXYYZm+1lITMMKsuE7gBQ/+DAH PshwCwmrCQ3PDG1LnJ1WRDKhqSWqcWJ2pkIIYr0hq2vM9mEvIZTKGvdSx8WmaNkRKW4i uMvE1gxh2UN7/ug65ZJIX/amQoP+2LXDDEJJQ2CqsgT+oYTav+yML/9B0P9YGYJQB5mf vmqQ== X-Gm-Message-State: ANhLgQ0NxkJSF8QlZzrWwFf1wtGonWMULPYhO/9GfB3jy9UerVamWqLq cvKbj7puENKSbWHVwwq/Mba+BkYa/F2xi+QV9ZrNB3nUMME= X-Google-Smtp-Source: ADFU+vuQDXfKglTvNg7IRIs9CEaDueiEiXzdtDnWKDvnmRW1FdXVvvLd4AVjEN6gYqdq2R1hJBu5Py9Ady73ZwcalAA= X-Received: by 2002:a05:6e02:be7:: with SMTP id d7mr8829518ilu.238.1585516195777; Sun, 29 Mar 2020 14:09:55 -0700 (PDT) MIME-Version: 1.0 References: <1848192.VuvhVD494M@omega> In-Reply-To: <1848192.VuvhVD494M@omega> From: Jeffrey Walton Date: Sun, 29 Mar 2020 17:09:44 -0400 Message-ID: Subject: Re: test-math.c:89:3: runtime error: division by zero To: Bruno Haible Content-Type: text/plain; charset="UTF-8" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::130 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: noloader@gmail.com Cc: bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" On Sun, Mar 29, 2020 at 12:24 PM Bruno Haible wrote: > > Jeffrey Walton wrote: > > This showed up during acosf testing with UBsan: > > > > test-math.c:89:3: runtime error: division by zero > > The code performs a division 1.0 / 0.0. This is a valid operation in > IEEE 854. It must produce a HUGE_VAL. > > Surely you can tell the sanitizer to ignore this? Well, my first reaction is, that sucks. I don't recall a situation where undefined behavior was conforming like that. Let's see what the GCC folks recommend: "GCC and division by 0 under sanitizers", https://gcc.gnu.org/pipermail/gcc-help/2020-March/138746.html. I tend to do what the GCC devs say. They write the compilers that remove the code with undefined behavior and produce unexpected results. It is wise to keep the compiler happy. Jeff