git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Thomas Rast <trast@inf.ethz.ch>
To: Heiko Voigt <hvoigt@hvoigt.net>
Cc: Torsten B?gershausen <tboegi@web.de>,
	Thomas Rast <trast@student.ethz.ch>, <git@vger.kernel.org>
Subject: Re: t1450-fsck (sometimes/often) failes on Mac OS X
Date: Sat, 28 Jul 2012 18:00:52 +0200	[thread overview]
Message-ID: <87hasrdgej.fsf@thomas.inf.ethz.ch> (raw)
In-Reply-To: <20120728154320.GA98893@book.hvoigt.net> (Heiko Voigt's message of "Sat, 28 Jul 2012 17:43:23 +0200")

Heiko Voigt <hvoigt@hvoigt.net> writes:

>         if (!git_index_file) {
> -               git_index_file = xmalloc(strlen(git_dir) + 7);
> +               git_index_file = xmalloc(strlen(git_dir) + 7 + 8);
>                 sprintf(git_index_file, "%s/index", git_dir);
>         }
[...]
> -       if (!memcmp(ent->base, objdir, pfxlen)) {
> +       objdirlen = strlen(objdir);
> +       if (!memcmp(ent->base, objdir, pfxlen > objdirlen ? objdirlen : pfxlen)) {
[...]
> Initialized empty Git repository in /Users/hvoigt/Repository/git/t/trash directory.t1450-fsck/another/.git/
> ==42686== Invalid read of size 8
> ==42686==    at 0x100625064: bcmp (in /usr/lib/libSystem.B.dylib)
> ==42686==    by 0x100112846: link_alt_odb_entries (in /Users/hvoigt/Repository/git/t/valgrind/../../git)
> ==42686==    by 0x1001129C0: read_info_alternates (in /Users/hvoigt/Repository/git/t/valgrind/../../git)
[...]
> ==42686==  Address 0x100faca78 is 8 bytes inside a block of size 13 alloc'd
> ==42686==    at 0x10029C679: malloc (vg_replace_malloc.c:266)
> ==42686==    by 0x1001349CD: xmalloc (in /Users/hvoigt/Repository/git/t/valgrind/../../git)
> ==42686==    by 0x1000C23F5: setup_git_env (in /Users/hvoigt/Repository/git/t/valgrind/../../git)

To me that looks just like a false positive.  memcmp (which seems to be
the same as bcmp) can load 8 bytes from an aligned address even if these
are only partially within the block being compared, since an aligned
load can never partially fault (it must all be within the same page).
Valgrind normally substitutes its own routines for memcmp etc. to
correctly handle this, but this does not seem to happen in your case for
some reason.

Then again I am not entirely sure how you could verify that this theory
is correct :-)

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

      reply	other threads:[~2012-07-28 16:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-14 12:21 t1450-fsck (sometimes/often) failes on Mac OS X Torsten Bögershausen
2012-07-15  9:08 ` Jeff King
2012-07-15 13:03   ` Torsten Bögershausen
2012-09-19 16:04   ` Torsten Bögershausen
2012-09-19 18:30     ` Junio C Hamano
2012-09-19 20:23       ` Torsten Bögershausen
2012-10-02 16:06       ` Torsten Bögershausen
2012-10-02 21:01         ` Junio C Hamano
2012-10-02 22:21           ` Junio C Hamano
2012-10-03 19:37             ` Torsten Bögershausen
2012-07-16  7:57 ` Thomas Rast
2012-07-16 16:06   ` Torsten Bögershausen
2012-07-28 15:43     ` Heiko Voigt
2012-07-28 16:00       ` Thomas Rast [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87hasrdgej.fsf@thomas.inf.ethz.ch \
    --to=trast@inf.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=hvoigt@hvoigt.net \
    --cc=tboegi@web.de \
    --cc=trast@student.ethz.ch \
    /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://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).