Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170629235624.GI1627@brightrain.aerifal.cx>
Date: Thu, 29 Jun 2017 19:56:24 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: [RFC PATCH] Allow annotating calloc for Valgrind

On Fri, Jun 30, 2017 at 02:42:53AM +0300, Alexander Monakov wrote:
> On Thu, 29 Jun 2017, Rich Felker wrote:
> > Use of valgrind annotation was already rejected a long time ago.
> 
> I don't see any record of that in the archives...

It reached the point of an faq item on irc; perhaps it was never
discussed on the ml.

> > The same can be done with a suppressions file and that's where it belongs.
> 
> What would you write in the suppression file? If you tell Valgrind to ignore
> branch-on-uninit in calloc, it will report errors later on anyway when the
> application reads from the calloc'ed region. Szabolcs went down that road once.

If that happens, it's just a valgrind bug. It can see the memory was
returned by calloc and therefore the contents are defined. But maybe
before discussing this further we need to clarify what the actual
scenario is. I thought normally valgrind does some trick to hook in
its own malloc implementation. Are there different ways of invoking it
where the system malloc gets used and instrumented? I've never been
able to get authoritative answers on anything related to this, so all
of the arguments have stumbled around whatever the person arguing
_claims_ valgrind does or needs to do...

> > The same could be achieved without hacks just using #if/#ifdef around
> > the #include. But I don't see how <memcheck.h> could work anyway; musl
> > obviously does not, and can't, use any host include paths where a
> > header might already be installed.
> 
> With an appropriate -I in CPPFLAGS?

Yes, that would presumably work, but I can imagine users making a huge
mess by putting some dir full of host headers (not just valgrind ones)
in the -I...

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.