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: 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 07:50:43 -0800	[thread overview]
Message-ID: <20130115155043.GA21815@sigill.intra.peff.net> (raw)
In-Reply-To: <7v38y38hhm.fsf@alter.siamese.dyndns.org>

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.

> diff --git a/t/valgrind/default.supp b/t/valgrind/default.supp
> index 0a6724f..032332f 100644
> --- a/t/valgrind/default.supp
> +++ b/t/valgrind/default.supp
> @@ -49,3 +49,11 @@
>  	Memcheck:Addr4
>  	fun:copy_ref
>  }
> +
> +{
> +	ignore-memcmp-reading-too-much-in-bsearch-callback
> +	Memcheck:Addr4
> +	fun:ref_entry_cmp_sslice
> +	fun:bsearch
> +	fun:search_ref_dir
> +}

Given that it is valgrind-clean on my platform, and reading the code I
don't see any problems, I think it probably is a false positive, and
this suppression makes sense.

-Peff

  parent reply	other threads:[~2013-01-15 15:51 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 [this message]
2013-01-15 16:55   ` Junio C Hamano
2013-01-15 17:18     ` Jeff King
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=20130115155043.GA21815@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 \
    /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).