mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: musl@lists.openwall.com
Cc: Constantine <iamvfx@gmail.com>
Subject: Re: Commit 01d4274 breaks Clang's LeakSanitizer when used with musl
Date: Thu, 2 Jul 2015 22:57:58 +0300 (MSK)	[thread overview]
Message-ID: <alpine.LNX.2.11.1507022248340.27424@monopod.intra.ispras.ru> (raw)
In-Reply-To: <20150702192916.GI32532@port70.net>

> i think the cause is that they intercept all allocation functions
> and if the act of interception calls into the intercepted function
> itself then they have a problem

This should never happen on musl since it links with -Bsymbolic-functions, and
even uses protected visibility now.
 
> for glibc calloc they have some ugly workaround, maybe similar hack
> is needed for free in musl, but none of this is future proof so
> they will just keep piling hacks..

Re: hacks, I think it doesn't have to be like that.  There should be a
reasonable mechanism to wrap library functions in the context of dynamic
linking; static linking is slightly ahead in that game if you count ld
--wrap=symbol functionality.

For dynamic linking it should be doable with a new type of ELF tag and a bit
of support from the dynamic linker.  Would you be interested?

(at the moment I don't have an answer why lsan started failing like that; and
even if, hypothetically, there would be a good library wrapping mechanism,
sanitizers would likely need other support from libc, like dynamic tls layout
discovery for memory sanitizer; I hope it can be resolved to everyone's
satisfaction eventually, improving sanitizers usability, rather than ignoring
it and perpetually calling sanitizers a pile of hacks)

Alexander


  parent reply	other threads:[~2015-07-02 19:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-02 18:22 Constantine
2015-07-02 19:00 ` Rich Felker
2015-07-02 19:29   ` Szabolcs Nagy
2015-07-02 19:45     ` Constantine
2015-07-02 21:10       ` Szabolcs Nagy
2015-07-02 19:46     ` Szabolcs Nagy
2015-07-02 19:57     ` Alexander Monakov [this message]
2015-07-02 20:20       ` Rich Felker
2015-07-02 22:11         ` Alexander Monakov

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=alpine.LNX.2.11.1507022248340.27424@monopod.intra.ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=iamvfx@gmail.com \
    --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).