From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11632 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [RFC PATCH] Allow annotating calloc for Valgrind Date: Thu, 29 Jun 2017 19:56:24 -0400 Message-ID: <20170629235624.GI1627@brightrain.aerifal.cx> References: <20170629225614.19061-1-amonakov@ispras.ru> <20170629232032.GH1627@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1498780598 9278 195.159.176.226 (29 Jun 2017 23:56:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 29 Jun 2017 23:56:38 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-11645-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jun 30 01:56:35 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dQjIY-0002Eh-Aj for gllmg-musl@m.gmane.org; Fri, 30 Jun 2017 01:56:34 +0200 Original-Received: (qmail 28482 invoked by uid 550); 29 Jun 2017 23:56:37 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 28451 invoked from network); 29 Jun 2017 23:56:37 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:11632 Archived-At: 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 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