git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>,
	git@vger.kernel.org, "Carlos Martín Nieto" <cmn@elego.de>,
	"Johannes Schindelin" <johannes.schindelin@gmx.de>
Subject: Re: [RFC/PATCH] ignore memcmp() overreading in bsearch() callback
Date: Tue, 15 Jan 2013 09:18:44 -0800	[thread overview]
Message-ID: <20130115171844.GA32227@sigill.intra.peff.net> (raw)
In-Reply-To: <7vmwwa4c8r.fsf@alter.siamese.dyndns.org>

On Tue, Jan 15, 2013 at 08:55:32AM -0800, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > On Mon, Jan 14, 2013 at 03:36:21PM -0800, Junio C Hamano wrote:
> >
> >> It appears that memcmp() uses the usual "one word at a time"
> >> comparison and triggers valgrind in a callback of bsearch() used in
> >> the refname search.  I can easily trigger problems in any script
> >> with test_commit (e.g. "sh t0101-at-syntax.sh --valgrind -i -v")
> >> without this suppression.
> >
> > Out of curiosity, what platform do you see this on? I can't reproduce on
> > glibc.
> 
>     Debian GNU/Linux 6.0.6 (squeeze), on Linux 2.6.32-5-amd64.
>     libc-bin              2.11.3-4
>     valgrind-3.6.0.SVN-Debian
>     gcc                   4:4.4.5-1

Interesting. I can reproduce easily on my squeeze machine, but not my
wheezy. So presumably it is a false positive fixed either in libc (I
have 2.13-38 on the "good" box) or valgrind (1:3.8.1-1).

However, the error that valgrind reports is on the call to
"strlen(ent->name)", not memcmp (but it has suffered from the same SSE
issues in the past).

So I feel pretty confident that it really is a false positive; you may
want to double-check the offending call for the commit message (though I
would not be surprised if it is triggerable from both). I think it also
means that René's suggestion to use strncmp cannot be relied on to
silence the warning (though I am not opposed to doing it anyway if we
think it is more clear).

-Peff

  reply	other threads:[~2013-01-15 17:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14 23:36 [RFC/PATCH] ignore memcmp() overreading in bsearch() callback Junio C Hamano
2013-01-14 23:56 ` Johannes Schindelin
2013-01-15  2:45   ` Junio C Hamano
2013-01-15 15:50 ` Jeff King
2013-01-15 16:55   ` Junio C Hamano
2013-01-15 17:18     ` Jeff King [this message]
2013-01-15 15:55 ` René Scharfe
2013-01-15 20:27   ` Andreas Schwab
2013-01-16  1:08     ` René Scharfe

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=20130115171844.GA32227@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=rene.scharfe@lsrfire.ath.cx \
    /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 NNTP newsgroup(s).