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: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 58A971F8C6 for ; Wed, 28 Jul 2021 08:15:43 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 92741398B88D for ; Wed, 28 Jul 2021 08:15:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92741398B88D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627460142; bh=LH8yC5PLaXG27mVsZXOQ45Kec9MesD6IgezfklYWbms=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=nsaLKhmFdV/gvCJNpwLQGqeoysTTi9vw+okBjc7arghGND6L1yvilx+DjqqIUyrFg 2SFzBiMBVkt+AGIw4f2pOy8PafDATksYuKgNixwzmPIi7J3+sVQPGcNHg9l4tXoyyK oyL8opU96qa5jH41WqiEvRgDFt3CBJNfCS636UCA= Received: from hamster.birch.relay.mailchannels.net (hamster.birch.relay.mailchannels.net [23.83.209.80]) by sourceware.org (Postfix) with ESMTPS id 757593988405 for ; Wed, 28 Jul 2021 07:26:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 757593988405 X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 25C76781ACE; Wed, 28 Jul 2021 07:26:18 +0000 (UTC) Received: from pdx1-sub0-mail-a75.g.dreamhost.com (100-96-17-89.trex.outbound.svc.cluster.local [100.96.17.89]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id A2699780D83; Wed, 28 Jul 2021 07:26:17 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a75.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.17.89 (trex/6.3.3); Wed, 28 Jul 2021 07:26:18 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Slimy-Name: 60fc106f076c3582_1627457177885_1209844993 X-MC-Loop-Signature: 1627457177885:2088361830 X-MC-Ingress-Time: 1627457177885 Received: from pdx1-sub0-mail-a75.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a75.g.dreamhost.com (Postfix) with ESMTP id 5B7888C383; Wed, 28 Jul 2021 00:26:17 -0700 (PDT) Received: from [192.168.1.143] (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a75.g.dreamhost.com (Postfix) with ESMTPSA id 7AFB38C377; Wed, 28 Jul 2021 00:26:14 -0700 (PDT) Subject: Re: [PATCH] __cxa_thread_atexit_impl: Return -1 on allocation failure To: Florian Weimer , Siddhesh Poyarekar via Libc-alpha References: <20210728062522.3904733-1-siddhesh@sourceware.org> <87mtq6ap0e.fsf@oldenburg.str.redhat.com> X-DH-BACKEND: pdx1-sub0-mail-a75 Message-ID: <8336a4c1-15bb-c3d2-6afe-cb9db60178dc@sourceware.org> Date: Wed, 28 Jul 2021 12:56:08 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87mtq6ap0e.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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: , From: Siddhesh Poyarekar via Libc-alpha Reply-To: Siddhesh Poyarekar Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 7/28/21 12:44 PM, Florian Weimer wrote: > * Siddhesh Poyarekar via Libc-alpha: > >> Return -1 in the unlikely event that allocation fails when trying to >> register a TLS destructor. > > This is bug 18524. As said on the bug, the interface is broken. We > really need to rework C++ global destructor support so that these > dynamic memory allocations become unnecessary. > > The GCC-generated caller code does not check the return value (and could > do anything with it anyway). You probable need to add __libc_fatal. Hmm, so I started with __libc_fatal and changed it to return -1 when I saw that the libstdc++ compat implementation did the same. Now I see that there's no check for return value from the call. I'll update the patch with __libc_fatal and resend. Thanks, Siddhesh