From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id 6415F3858405 for ; Mon, 15 Nov 2021 21:04:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6415F3858405 Received: by mail-pg1-x52d.google.com with SMTP id p17so15645436pgj.2 for ; Mon, 15 Nov 2021 13:04:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xjHYoTUOVoDMD/K9UZHqLiY37shPePbIUsqMCoD/F5o=; b=TAr62SNXtMLpa3R1+ALdY6W/k1Gco2bsbSle/jWWzAiP/lzyBUwLzk14CSddAs3nDZ VfRaY3PzPZvickmnJZBqYSUBZtjSqMztQhrRE6qnYjg4Wdrc3Mdz/lePnHTX77/icgvX 54huuJowZYsLS23GzXT8BJvRy6y+qdFbNvUTEsHY+SeFIMsnFBmz3TbXf5uSUaXs/sSX t3drxhJd8b4juFLE75E4NTCFQR1iFm4Y4HnEevQZBDbXrNaTr+tBB4I3rGq/5Y8rDTo6 +0ksa76Q5GuFwBegQjaXVAdqWC8VbfnsZPXjTBkPcR0h7xJ7hLWpV2hzuluZxySE1mea iK2A== X-Gm-Message-State: AOAM533kOuh9C6/M8/wI5On6rxt7ja7WYwwaNiyq8U/wd8RLntV+BJWS BGC+gV4htQuPM/7KIsW4SojgM4I9Q2U= X-Google-Smtp-Source: ABdhPJyfHQbnA9TCf7t2T6RBLQ+7AyQZDlIWRE1KT28fwA0PGzbN9H1fp2aW2ZIkcemPJKTj9Td0fQ== X-Received: by 2002:a63:5014:: with SMTP id e20mr1270175pgb.480.1637010244386; Mon, 15 Nov 2021 13:04:04 -0800 (PST) Received: from localhost ([2409:10:24a0:4700:e8ad:216a:2a9d:6d0c]) by smtp.gmail.com with ESMTPSA id p25sm16236531pfh.86.2021.11.15.13.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 13:04:03 -0800 (PST) Date: Tue, 16 Nov 2021 06:04:01 +0900 From: Stafford Horne To: Siddhesh Poyarekar Cc: GLIBC patches Subject: Re: [PATCH] malloc: Fix malloc debug for 2.35 onwards Message-ID: References: <20211113004047.1980486-1-shorne@gmail.com> <98e3b40a-3d1f-bac9-997b-22a659a1200b@gotplt.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <98e3b40a-3d1f-bac9-997b-22a659a1200b@gotplt.org> X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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: Mon, 15 Nov 2021 21:04:07 -0000 On Mon, Nov 15, 2021 at 08:04:25AM +0530, Siddhesh Poyarekar wrote: > On 11/13/21 06:10, Stafford Horne wrote: > > 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 > > What symbols does this change generate? Could you please share the output > of objdump -T malloc/libc_malloc_debug.so from your build? Here it is: ../build-glibc/malloc/libc_malloc_debug.so: file format elf32-or1k DYNAMIC SYMBOL TABLE: 00001114 l d .text 00000000 .text 0000a7c8 l d .rodata 00000000 .rodata 0000b7c0 l d .eh_frame 00000000 .eh_frame 0000df00 l d .tbss 00000000 .tbss 0000e000 l d .data 00000000 .data 0000e574 l d .bss 00000000 .bss 00000000 DF *UND* 00000000 GLIBC_2.35 fclose 00000000 DF *UND* 00000000 GLIBC_2.35 __libc_free 00000000 DF *UND* 00000000 GLIBC_PRIVATE __lll_lock_wake_private 00000000 w D *UND* 00000000 Base _ITM_deregisterTMCloneTable 00000000 D *UND* 00000000 GLIBC_PRIVATE errno 00000000 DF *UND* 00000000 GLIBC_2.35 __libc_memalign 00000000 DF *UND* 00000000 GLIBC_PRIVATE __libc_fatal 00000000 DO *UND* 00000000 GLIBC_2.35 _libc_intl_domainname 00000000 DF *UND* 00000000 GLIBC_PRIVATE __mmap 00000000 DF *UND* 00000000 GLIBC_2.35 __libc_malloc 00000000 DF *UND* 00000000 GLIBC_PRIVATE __munmap 00000000 DF *UND* 00000000 GLIBC_2.35 __assert_fail 00000000 DO *UND* 00000000 GLIBC_PRIVATE __libc_enable_secure 00000000 DF *UND* 00000000 GLIBC_2.35 dlsym 00000000 DF *UND* 00000000 GLIBC_2.35 mremap 00000000 DF *UND* 00000000 GLIBC_PRIVATE __open_nocancel 00000000 DF *UND* 00000000 GLIBC_2.35 setvbuf 00000000 DF *UND* 00000000 GLIBC_2.35 sprintf 00000000 DF *UND* 00000000 GLIBC_2.35 __sbrk 00000000 w DF *UND* 00000000 GLIBC_2.35 __cxa_finalize 00000000 DF *UND* 00000000 GLIBC_2.35 __dcgettext 00000000 DF *UND* 00000000 GLIBC_PRIVATE __mprotect 00000000 DO *UND* 00000000 GLIBC_PRIVATE _rtld_global_ro 00000000 DF *UND* 00000000 GLIBC_2.35 fopen 00000000 DF *UND* 00000000 GLIBC_2.35 funlockfile 00000000 DF *UND* 00000000 GLIBC_2.35 sysconf 00000000 DF *UND* 00000000 GLIBC_2.35 flockfile 00000000 DF *UND* 00000000 GLIBC_PRIVATE __read_nocancel 00000000 DO *UND* 00000000 GLIBC_2.35 stderr 00000000 DF *UND* 00000000 GLIBC_2.35 memset 00000000 DF *UND* 00000000 GLIBC_2.35 __libc_realloc 00000000 DF *UND* 00000000 GLIBC_2.35 fprintf 00000000 DF *UND* 00000000 GLIBC_2.35 secure_getenv 00000000 DF *UND* 00000000 GLIBC_2.35 __libc_freeres 00000000 DF *UND* 00000000 GLIBC_PRIVATE __madvise 00000000 DF *UND* 00000000 GLIBC_2.35 strlen 00000000 DF *UND* 00000000 GLIBC_2.35 memcpy 00000000 DF *UND* 00000000 GLIBC_2.35 dladdr 00000000 DF *UND* 00000000 GLIBC_PRIVATE __tunable_get_val 00000000 DF *UND* 00000000 GLIBC_2.35 __cxa_atexit 00000000 w D *UND* 00000000 Base _ITM_registerTMCloneTable 00000000 DF *UND* 00000000 GLIBC_PRIVATE __lll_lock_wait_private 00000000 DF *UND* 00000000 GLIBC_PRIVATE __close_nocancel 00000000 DF *UND* 00000000 GLIBC_2.35 fwrite 0000e498 g DO .data 00000004 GLIBC_2.35 __realloc_hook 0000e7c8 g DO .bss 00000004 GLIBC_2.35 __free_hook 00000000 g DO *ABS* 00000000 GLIBC_2.35 GLIBC_2.35 00009814 g DF .text 00000024 GLIBC_2.35 mcheck_pedantic 00009c2c g DF .text 00000104 GLIBC_2.35 pvalloc 000095fc g DF .text 0000011c GLIBC_2.35 free 000099c8 g DF .text 000001a4 GLIBC_2.35 realloc 0000a470 g DF .text 00000138 GLIBC_2.35 mallinfo2 00009d30 g DF .text 000000a8 GLIBC_2.35 valloc 00004450 g DF .text 00000024 GLIBC_2.35 mcheck_check_all 00004474 g DF .text 00000020 GLIBC_2.35 mprobe 0000e494 g DO .data 00000004 GLIBC_2.35 __memalign_hook 00009bb4 g DF .text 00000030 GLIBC_2.35 aligned_alloc 0000e49c g DO .data 00000004 GLIBC_2.35 __malloc_hook 0000a1b4 g DF .text 000000f8 GLIBC_2.35 malloc_info 000044b4 g DF .text 00000020 GLIBC_2.35 muntrace 0000a138 g DF .text 0000007c GLIBC_2.35 malloc_usable_size 00009dd8 g DF .text 000000bc GLIBC_2.35 posix_memalign 000097f0 g DF .text 00000024 GLIBC_2.35 mcheck 00004494 g DF .text 00000020 GLIBC_2.35 mtrace 0000a3a4 g DF .text 000000cc GLIBC_2.35 malloc_stats 00009e94 g DF .text 000002a4 GLIBC_2.35 calloc 0000a6e0 g DF .text 000000e8 GLIBC_2.35 malloc_trim 00009bb4 g DF .text 00000030 GLIBC_2.35 memalign 0000a5a8 g DF .text 00000138 GLIBC_2.35 mallinfo 000091a0 g DF .text 00000180 GLIBC_2.35 malloc 0000a2ac g DF .text 000000f8 GLIBC_2.35 mallopt