public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: Siddhesh Poyarekar <siddhesh@sourceware.org>
Cc: GLIBC patches <libc-alpha@sourceware.org>,
	Florian Weimer <fweimer@redhat.com>
Subject: Re: [PATCH v10 00/11] malloc hooks removal
Date: Sat, 9 Oct 2021 06:47:25 +0900	[thread overview]
Message-ID: <CAAfxs75wQ4adMsnLRTpAPGZZv8k=OSpO3M89RAd4pnJdOJAU0w@mail.gmail.com> (raw)
In-Reply-To: <20210719184637.1225275-1-siddhesh@sourceware.org>

On Tue, Jul 20, 2021 at 3:48 AM Siddhesh Poyarekar via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> This patchset removes the malloc hooks __malloc_hook, __free_hook,
> __realloc_hook and __memalign_hook from the API and leaves compatibility
> symbols so that existing applications can continue to link to them.  The
> reading and execution of the hooks has been moved to a DSO
> libc_malloc_debug.so, which can be preloaded for applications that need
> it.  By default these hooks no longer have any effect in the library.
>
> Further, debugging features such as MALLOC_CHECK_, mcheck() and mtrace
> have been weaned away from these hooks and also moved to
> libc_malloc_debug.so.  With this change, these features are only enabled
> when libc_malloc_debug.so is preloaded using LD_PRELOAD.
>
> Finally, the __morecore, __morecore_after_hook and __default_morecore
> hooks have also been moved to compat symbols and removed from the API.
> Existing applications will continue to link to them but they won't have
> any effect on malloc behaviour.

Hello,

I am working on an OpenRISC port and have just rebased and picked up
this series.  I
also have updated the api version to 2.35.  After this all of the
mtrace related *-mem
tests seem to be failing.

Is this expected to be completely removed after going to 2.35 and the
compatibility APIs
get compiled out?  If so, then the tests should be skipped, if not
then then something is broken
for glibcs with base version 2.35:

For example:

    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.

When I have looked into mtrace I can see a few strange things:

  In libc.so mtrace is a nop (that seems to be what you wanted for this series).
    000b5bb4 <mtrace>:
       b5bb4:       44 00 48 00     l.jr r9
       b5bb8:       15 00 00 00     l.nop 0x0

    000b5bbc <muntrace>:
       b5bbc:       44 00 48 00     l.jr r9
       b5bc0:       15 00 00 00     l.nop 0x0

Also, I am also seeing basically nothing in libc_malloc_debug.so  either:

    < shorne@antec ~/work/gnu-toolchain/build-glibc > nm
../build-glibc/malloc/libc_malloc_debug.so
    000000f4 r __abi_tag
    00004020 b completed.0
             w __cxa_finalize@GLIBC_2.35
    00000314 t deregister_tm_clones
    00000404 t __do_global_dtors_aux
    00003f0c d __do_global_dtors_aux_fini_array_entry
    00004000 d __dso_handle
    00003f10 a _DYNAMIC
    00000484 t frame_dummy
    00003f08 d __frame_dummy_init_array_entry
    0000048c r __FRAME_END__
    00000000 A GLIBC_2.35
    00004004 a _GLOBAL_OFFSET_TABLE_
             w _ITM_deregisterTMCloneTable
             w _ITM_registerTMCloneTable
    0000037c t register_tm_clones
    00004004 d __TMC_END__

-Stafford

  parent reply	other threads:[~2021-10-08 21:47 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 18:46 Siddhesh Poyarekar
2021-07-19 18:46 ` [PATCH v10 01/11] Make mcheck tests conditional on GLIBC_2.23 or earlier Siddhesh Poyarekar
2021-07-22 12:26   ` Carlos O'Donell
2021-07-19 18:46 ` [PATCH v10 02/11] Remove __after_morecore_hook Siddhesh Poyarekar
2021-07-19 18:46 ` [PATCH v10 03/11] Remove __morecore and __default_morecore Siddhesh Poyarekar
2021-07-19 18:46 ` [PATCH v10 04/11] Move malloc hooks into a compat DSO Siddhesh Poyarekar
2021-07-22 12:25   ` Carlos O'Donell
2021-07-19 18:46 ` [PATCH v10 05/11] mcheck: Wean away from malloc hooks [BZ #23489] Siddhesh Poyarekar
2021-07-22 19:57   ` Matheus Castanho
2021-07-23  2:25     ` [PATCH] Fix build and tests with --disable-tunables Siddhesh Poyarekar
2021-07-23  4:55       ` Carlos O'Donell
2021-07-19 18:46 ` [PATCH v10 06/11] Simplify __malloc_initialized Siddhesh Poyarekar
2021-07-19 18:46 ` [PATCH v10 07/11] mtrace: Wean away from malloc hooks Siddhesh Poyarekar
2021-07-19 18:46 ` [PATCH v10 08/11] glibc.malloc.check: " Siddhesh Poyarekar
2021-07-22 12:25   ` Carlos O'Donell
2021-07-19 18:46 ` [PATCH v10 09/11] Move malloc_{g,s}et_state to libc_malloc_debug Siddhesh Poyarekar
2021-07-22 12:25   ` Carlos O'Donell
2021-07-19 18:46 ` [PATCH v10 10/11] Remove malloc hooks [BZ #23328] Siddhesh Poyarekar
2021-07-19 18:46 ` [PATCH v10 11/11] mcheck Fix malloc_usable_size [BZ #22057] Siddhesh Poyarekar
2021-07-21  9:45 ` [PATCH v10 00/11] malloc hooks removal Siddhesh Poyarekar
2021-10-08 21:47 ` Stafford Horne [this message]
2021-10-08 22:22   ` DJ Delorie
2021-10-08 23:18     ` Stafford Horne
2021-10-08 23:24       ` DJ Delorie
2021-10-08 23:29         ` Stafford Horne
2021-10-08 23:48           ` Stafford Horne
2021-10-11  2:40             ` Siddhesh Poyarekar
2021-10-11  1:55   ` Siddhesh Poyarekar
2021-10-11  2:19     ` Siddhesh Poyarekar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAfxs75wQ4adMsnLRTpAPGZZv8k=OSpO3M89RAd4pnJdOJAU0w@mail.gmail.com' \
    --to=shorne@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=siddhesh@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).