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=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,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 A91751F4B4 for ; Sun, 18 Apr 2021 20:24:57 +0000 (UTC) Received: from localhost ([::1]:35766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYDyS-0005cO-Gb for normalperson@yhbt.net; Sun, 18 Apr 2021 16:24:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYDx2-0004v5-9u for bug-gnulib@gnu.org; Sun, 18 Apr 2021 16:23:28 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.218]:31037) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYDwx-0002jI-Tz for bug-gnulib@gnu.org; Sun, 18 Apr 2021 16:23:28 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1618777401; cv=none; d=strato.com; s=strato-dkim-0002; b=QLfbx00H4p9Ebd4GKF99rR7FBiIbecbj54wyuLgqOBHpuuJUEJmtyYEwALLhxWdFKF ITDBeJdzIfH3uhn7Mc00JZsE6SmYs23G4DiR9hEbzMzB6aKvBgYjE9g3Yqp9mhM/ghxr z039qVmK7Oyw46EwTZMczMrgytufXKnbi2Pgo5dnuWN5keiiplv1GTTT9bZ+ZmUuxVAp 8/UyYJTQlaZ4ESL+mgr6xrIicLMmi0mUsPtIoLSQcvTiliWWKRsL9IHs+R52EIz4uQ/h CzsgMhYr+38to5qgBZebyQRXxkkiuJCFU1rJUd6H8FcXlOE4vzDiasM30V5iqpipo/7z H0Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1618777401; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=NmsKShDCnqSPxKbWlmPH4QgW0jUM0aWdd1BwCRYlfoU=; b=NKbtolJ1H/OHyl60mJ4pPSdAccSGr7Z6/173lGem55F3HOJbku1rX3D8lQIgSyA/qO 0k15FNv5+He6k3c1UjLW1XscGxWcwPV8Sh2ScSYNOlE4jdRBcE7P8kNmM+NaseufiOXp aGJ8xQw5Oijh3+BMABNtaPbQ8yM1M60Fg89M1AuczEZoBau113QnugxuOJ2qoZiNmskg NFFQ+yYzCoUCYhzxjwORAzxiT2wtdr5bB1lul4gjiJdY/P+Q0PcYjzWMFeoffJ9cd7z5 Ga8FFgEZtz4e5bWaOg/LOKmugc49kUFRZexfoCJXAdW5bYuR1Jun1nsNiRqXApZ9O6ih 88tQ== ARC-Authentication-Results: i=1; strato.com; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1618777401; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=NmsKShDCnqSPxKbWlmPH4QgW0jUM0aWdd1BwCRYlfoU=; b=djhPjm2QTQzyjg1SdO/YdraGwVOdxixwUxuBUPhoD+4UfjPR0CQ1z2TAe4Fb6rWySK zx6DyOo7e8PsAsFyx8F6BsMGScC9F0Q3TU1fDEV7vb5u66OKk0+6cCsJFLlL6C1MbPGn j4v74stkZD6iTbm0WvGehza8P1yXZnoJW+BA8P4E3Q6Q8J/5zXdAKO6rMuBahwPLNb8J 8G2N57NDSopJpRYDrXV28gAtRVKsbB8KoOL7NFwGAC7ZahVFcsDdztP82wWCzRbGei7h fqHYoguTDvZVXjPxKBDHz3Y2lnHBXkjbWtuJhUCtj9Gq+P5Wmt6Os2NGXOiZpPRW4qgb OqbA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOHqf3z5NW" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 47.24.3 DYNA|AUTH) with ESMTPSA id N0a7e0x3IKNLDCG (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Sun, 18 Apr 2021 22:23:21 +0200 (CEST) From: Bruno Haible To: Paul Eggert Subject: Re: ptrdiff_t overflow checks for malloc-posix etc. Date: Sun, 18 Apr 2021 22:23:19 +0200 Message-ID: <2648715.cSpuM7zsZe@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-206-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <4f4a34d3-d9f5-6a84-ab4b-0967d9fa2c51@cs.ucla.edu> References: <64417dd6-7edb-2045-d827-2dd24b151205@cs.ucla.edu> <3584954.903fD1VjPb@omega> <4f4a34d3-d9f5-6a84-ab4b-0967d9fa2c51@cs.ucla.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=81.169.146.218; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Cc: bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi Paul, > > How about extending the unit test (tests/test-malloc-gnu.c) accordingly? > > Won't that raise the possibility of the tests being too expensive, in > case the C library actually attempts to allocate PTRDIFF_MAX + 1 bytes? In those cases where our code has a bug and the xalloc_oversized test in malloc.c is not effective, yes, the test program may allocate a lot of memory. If we put the test in a module that is marked as Status: privileged-test normal users will never get to execute this test. Bruno