mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Cc: Florian Weimer <fw@deneb.enyo.de>
Subject: Re: tcmalloc compatibility
Date: Tue, 10 Apr 2018 23:17:24 +0200	[thread overview]
Message-ID: <20180410211724.GJ4418@port70.net> (raw)
In-Reply-To: <20180410204411.GK3094@brightrain.aerifal.cx>

* Rich Felker <dalias@libc.org> [2018-04-10 16:44:11 -0400]:
> On Tue, Apr 10, 2018 at 10:33:55PM +0200, Szabolcs Nagy wrote:
> > - glibc dlsym calls calloc (bites anybody who tries to wrap
> > calloc in the usual way)
> 
> Yes. While I think it's unreasonable that glibc calls calloc from
> dlsym, I also think it's unreasonable to be calling dlsym from a
> malloc replacement. I don't think I would include dlsym or other
> heavy, AS-unsafe functions in an allowed-list for musl.

then the wrappers with dlsym(RTLD_NEXT,sym) would not work.
(malloc checkers, valgrind, sanitizers etc all do it)

in glibc there is __libc_calloc so you can get the address
without dlsym, but in general you cannot wrap libc functions
for instrumentation if dlsym is disallowed.

i guess one could run dlsym early to initialize global
pointers but then the interceptor still has to handle the
case when it gets called before the appropriate dlsym is done,
so users need to know what dlsym might call and how to do the
initialization early enough.


  reply	other threads:[~2018-04-10 21:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 10:22 Denis V. Razumovsky
2018-04-10 14:33 ` Rich Felker
2018-04-10 14:45   ` Bobby Powers
2018-04-10 15:35     ` Rich Felker
     [not found]   ` <878t9vlzh1.fsf@mid.deneb.enyo.de>
2018-04-10 18:39     ` Rich Felker
2018-04-10 20:33     ` Szabolcs Nagy
2018-04-10 20:44       ` Rich Felker
2018-04-10 21:17         ` Szabolcs Nagy [this message]
2018-04-15 11:52           ` ardi
2018-04-16  4:19             ` Markus Wichmann
2018-04-16  4:40               ` Rich Felker
2018-04-18 20:35                 ` Rich Felker
2018-04-19 18:27                   ` Szabolcs Nagy
2018-04-19 19:11                     ` Rich Felker
2018-04-18 20:50       ` Florian Weimer
2018-04-18 21:06         ` Rich Felker

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=20180410211724.GJ4418@port70.net \
    --to=nsz@port70.net \
    --cc=fw@deneb.enyo.de \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).