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.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 2A5E51F8C8 for ; Fri, 8 Oct 2021 23:30:20 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 02959385840F for ; Fri, 8 Oct 2021 23:30:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02959385840F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633735819; bh=WctYJw4Kzzu+Adr+4YhBj5bRcJ0z2w0KvmvDNOJ9IAk=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=OFvCTQWzQ4f9OtThhHHGUkHlGETpM2NldxRcN4uad4rHjwkB1f1CZJWNNGxgpKQcR ChiDO8sQZo10S+R0UNn/nkns5SPNOEW1at4CpDnOnn14SJqD9jLiMhsVc8Muvjqhl4 PJg52vlcV50qbtPQEu7ZLuwl4qajaAUb/nS5e7No= Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id 27C9A3858400 for ; Fri, 8 Oct 2021 23:29:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 27C9A3858400 Received: by mail-ed1-x52f.google.com with SMTP id g10so41158176edj.1 for ; Fri, 08 Oct 2021 16:29:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WctYJw4Kzzu+Adr+4YhBj5bRcJ0z2w0KvmvDNOJ9IAk=; b=muZxWPLdq4k6CRmm1lSkmixKakL9GQkQex6SxudVgTG2ITF8eV1Ai7Kns7kMcKXBy3 lzM5ExcEgt3cODwNG755SiulahwD4cfOx+oYAXiLnrAF4KNsJgbZWJBf2GxMOl69RGVv mh3G0FTui7tE9d+zqsshxGTKV1/XT3E17/1jNbIewqVUm9XrK66rf/E1b5qHYTkDCcZU 1qOudpMZTHtWrBW72RGczWpDY9JhH2X1KBqBF3UEOKhfE7HUFamOFOd2FYGAQEnPjf/R sPGemKCGmxSzBi7xJljNfKt3BlsQK4FusImkt16MFbtzBhU1IAZYb93DA78gXE6YbNdD gYqQ== X-Gm-Message-State: AOAM532ZHSkr3J1qFeoQnLlTyKtcPGBjESjlfKQGbBNKIrfZj4hxULz+ 9KaN6X1R0TMM1XWOCWGP7CrKGVoVZrdoiBL/zfp7KMrIv/0= X-Google-Smtp-Source: ABdhPJxkc8hdYrxjK1OkaQ1MvE3yQAJGezNY7Ze4KwT9ft0ZSPYzQ3wo1by5PbofXnJxGlngIQUQAM7L1zxrUhYFi9s= X-Received: by 2002:a50:bf4d:: with SMTP id g13mr18574313edk.195.1633735798289; Fri, 08 Oct 2021 16:29:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 9 Oct 2021 08:29:47 +0900 Message-ID: Subject: Re: [PATCH v10 00/11] malloc hooks removal To: DJ Delorie Content-Type: text/plain; charset="UTF-8" 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: Stafford Horne via Libc-alpha Reply-To: Stafford Horne Cc: GLIBC patches Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Sat, Oct 9, 2021 at 8:24 AM DJ Delorie wrote: > > Stafford Horne writes: > > Is the issue in malloc/malloc-debug.c? There is a big if for > > GLIBC_2_0 -> GLIBC_2_34. > > It seems from GLIBC_2_35 nothing is available any longer. Is that > > correct, that is what is happening. > > Yes. Old ports get compatibility symbols that do nothing. New ports > get no symbols since there are no old apps that would have been linked > against them. > > If yours is the first new port since we made this change, there might be > some debugging needed... I think maybe this is the issue. The first #if is not terminated, and it keeps the include of mtrace.c/mcheck.c from being included. Those includes should provide the real implementations of mtrace/muntrace to be overloaded with the LD_PRELOAD. I am not sure where we should end the if though. I can test something. #if SHLIB_COMPAT (libc_malloc_debug, GLIBC_2_0, GLIBC_2_34) /* Support only the glibc allocators. */ extern void *__libc_malloc (size_t); extern void __libc_free (void *); extern void *__libc_realloc (void *, size_t); extern void *__libc_memalign (size_t, size_t); extern void *__libc_valloc (size_t); extern void *__libc_pvalloc (size_t); extern void *__libc_calloc (size_t, size_t); .... #include "mcheck.c" #include "mtrace.c" #include "malloc-check.c" #if SHLIB_COMPAT (libc_malloc_debug, GLIBC_2_0, GLIBC_2_24) extern void (*__malloc_initialize_hook) (void); compat_symbol_reference (libc, __malloc_initialize_hook, __malloc_initialize_hook, GLIBC_2_0); #endif