From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by sourceware.org (Postfix) with ESMTPS id 6E5FD385840B for ; Sat, 13 Nov 2021 00:40:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6E5FD385840B Received: by mail-pj1-x1031.google.com with SMTP id j6-20020a17090a588600b001a78a5ce46aso8439575pji.0 for ; Fri, 12 Nov 2021 16:40:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QKwErJmj9E9haG7WGfTTFaU90Cp8uqR/kVLEpK3WwnQ=; b=eY4/dScLYHINA9txbXwoKVf0rRhqJ2KmeJxT4P8l99jIwA/WBgU4R4fVIxEOwHqhnr BIWTQjplzZJbCJDNqpZR81VPtaiWlhGIxW+w4pnNA5BqJ1uXgKRosIHGh1QPO1wdJGcU MMWT2oU8b0zfar4LuqfjjL34sbJvm/wAD4Gnbkbn3egxCzYy43uA7g6+6xE9aNW+/gBZ kPZp5Sm2mc3kK/qIJ+XMsdYK72GkP71yRzG4g3ETMczCgCjjI5oWLrIhVWtQDYNZFFf/ MmrpFc+TUYVeIjnDaQ9aEKkvHUE2MbTPcCrOXhPtScmmsN4S8iDnjh5fuJk+LQPNIlRM F1jg== X-Gm-Message-State: AOAM530hKp/oog3ubD5MPSa1ZqaoIryMRVue45PvJmKAjEXZecaKSTfh w33q05wtsHvRUfLtH7/0ITzuPsMuGpY= X-Google-Smtp-Source: ABdhPJwJoX2VMfPmO86IDWnnNzEzx/4jomS3i1SOEIzi4nCkWHDUokX4WAXOIIKj7NXhK8mf96g42A== X-Received: by 2002:a17:903:185:b0:141:f5f3:dae with SMTP id z5-20020a170903018500b00141f5f30daemr12899302plg.56.1636764054177; Fri, 12 Nov 2021 16:40:54 -0800 (PST) Received: from localhost ([2409:10:24a0:4700:e8ad:216a:2a9d:6d0c]) by smtp.gmail.com with ESMTPSA id mp12sm11806496pjb.39.2021.11.12.16.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Nov 2021 16:40:53 -0800 (PST) From: Stafford Horne To: GLIBC patches Subject: [PATCH] malloc: Fix malloc debug for 2.35 onwards Date: Sat, 13 Nov 2021 09:40:47 +0900 Message-Id: <20211113004047.1980486-1-shorne@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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: Sat, 13 Nov 2021 00:40:56 -0000 The change 1e5a5866cb ("Remove malloc hooks [BZ #23328]") has broken ports that are using GLIBC_2_35, like the new OpenRISC port I am working on. The libc_malloc_debug.so library used to bring in the debug infrastructure is currently essentially empty for GLIBC_2_35 ports like mine causing mtrace tests to fail: cat sysdeps/unix/sysv/linux/or1k/shlib-versions DEFAULT GLIBC_2.35 ld=ld-linux-or1k.so.1 FAIL: posix/bug-glob2-mem FAIL: posix/bug-regex14-mem FAIL: posix/bug-regex2-mem FAIL: posix/bug-regex21-mem FAIL: posix/bug-regex31-mem FAIL: posix/bug-regex36-mem FAIL: malloc/tst-mtrace. The issue seems to be with the ifdefs in malloc/malloc-debug.c. The ifdefs are currently essentially exluding all symbols for ports > 2.35. In short: if (SHLIB_COMPAT 2.0 -> 2.34) debug api inlcude .c files implement apis Generate debug compat api endif This fix changes this to: debug api inlcude .c files implement apis if (SHLIB_COMPAT 2.0 -> 2.34) Generate debug compat api endif Fixes: 1e5a5866cb ("Remove malloc hooks [BZ #23328]") Cc: Siddhesh Poyarekar --- malloc/malloc-debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/malloc/malloc-debug.c b/malloc/malloc-debug.c index 3d7e6d44fd..6f2b6a2d23 100644 --- a/malloc/malloc-debug.c +++ b/malloc/malloc-debug.c @@ -24,7 +24,6 @@ #include #include -#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 *); @@ -640,6 +639,7 @@ compat_symbol (libc_malloc_debug, malloc_set_state, malloc_set_state, GLIBC_2_0); #endif +#if SHLIB_COMPAT (libc_malloc_debug, GLIBC_2_0, GLIBC_2_34) /* Do not allow linking against the library. */ compat_symbol (libc_malloc_debug, aligned_alloc, aligned_alloc, GLIBC_2_16); compat_symbol (libc_malloc_debug, calloc, calloc, GLIBC_2_0); -- 2.31.1