From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from butterfly.birch.relay.mailchannels.net (butterfly.birch.relay.mailchannels.net [23.83.209.27]) by sourceware.org (Postfix) with ESMTPS id D2CDF3984C2C for ; Fri, 2 Jul 2021 19:07:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D2CDF3984C2C 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 85ABE702146; Fri, 2 Jul 2021 19:07:08 +0000 (UTC) Received: from pdx1-sub0-mail-a39.g.dreamhost.com (100-101-162-64.trex.outbound.svc.cluster.local [100.101.162.64]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 134BA702A7F; Fri, 2 Jul 2021 19:07:08 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a39.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.101.162.64 (trex/6.3.3); Fri, 02 Jul 2021 19:07:08 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Rock-Wipe: 38794cb0278da1fe_1625252828361_144488873 X-MC-Loop-Signature: 1625252828360:31451684 X-MC-Ingress-Time: 1625252828360 Received: from pdx1-sub0-mail-a39.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a39.g.dreamhost.com (Postfix) with ESMTP id BE1C27EE56; Fri, 2 Jul 2021 12:07:07 -0700 (PDT) Received: from [192.168.1.136] (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-a39.g.dreamhost.com (Postfix) with ESMTPSA id 054AC7F451; Fri, 2 Jul 2021 12:07:04 -0700 (PDT) Subject: Re: [PATCH v4 08/10] Remove malloc hooks To: Carlos O'Donell , libc-alpha@sourceware.org Cc: dj@redhat.com, fweimer@redhat.com References: <20210702113845.3367306-1-siddhesh@sourceware.org> <20210702113845.3367306-9-siddhesh@sourceware.org> X-DH-BACKEND: pdx1-sub0-mail-a39 From: Siddhesh Poyarekar Message-ID: <93c35acb-98d7-bf13-e0c7-94743eac4aea@sourceware.org> Date: Sat, 3 Jul 2021 00:36:59 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3486.8 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=no 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: Fri, 02 Jul 2021 19:07:12 -0000 On 7/3/21 12:18 AM, Carlos O'Donell wrote: > On 7/2/21 7:38 AM, Siddhesh Poyarekar wrote: >> Make malloc hooks symbols compat-only so that new applications cannot >> link against them and remove the declarations from the API. The >> existing hooks variables are not used in the library anymore. > > I *really* like the strategy of your approach calling __libc_malloc > et. al. to avoid the dlopen problem and declare we only support glibc > malloc. I think this patch is a winner, and you could move mtrace > into this DSO, and rename it. > >> Legacy applications that need hooks functionality need to preload a >> new DSO libmalloc_compathooks.so, which interposes the libc malloc >> functions to execute hooks if they exist. > > ... and you could implement mtrace this way too without the ABI change. Hmm, ok. >> Also remove all references to the malloc hooks in the manual. Mention >> the removal in NEWS and also warn that libmalloc_compathooks.so is a >> temporary measure and may be removed in a future version of glibc. >> >> memalign makes a comeback as a PLT reference since the initialization >> hooks use them. tst-mallocstate now needs libmalloc_compathooks.so >> since it uses __malloc_initialize_hook to set up initial heap state to >> emumate emacs. > > This patch is broken, there are two tests which it references which > don't exist. Indeed, sorry, I forgot to git-add the tests :/ I'll fix that up. > The hooks are a debug feature of this interposable debug malloc. > > I think we should identify the library and the purpose e.g. > > libc_malloc_debug.so > > *cough* libtcmalloc_debug.so.4.5.6 *cough* OK, I'll move all the debug hooks into the DSO. /me wipes a tear as he says goodbye to malloc-check. Siddhesh