From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: valgrind patches, was Re: What's cooking in git.git (Jan 2009, #04; Mon, 19)
Date: Wed, 21 Jan 2009 02:26:56 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.1.00.0901210216440.19014@racer> (raw)
In-Reply-To: <20090121003739.GA18373@coredump.intra.peff.net>
Hi,
On Tue, 20 Jan 2009, Jeff King wrote:
> On Wed, Jan 21, 2009 at 01:28:01AM +0100, Johannes Schindelin wrote:
>
> > Actually, I test first if it is there, and only if it is not, try to
> > create the symlink.
> >
> > Now, there is still a very minor chance for a race, namely if two
> > processes happen to test the existence of the missing symlink at exactly
> > the same time, and both do not find it, so both processes will try to
> > create it.
>
> Yep. Though I find "minor chance" when it comes to races to really mean
> "annoying to debug". But...
Well, in this case, you will find that the "bug" is _at most_ some
binaries not being found.
And really, the chance is so small as to be forgotten in the clutter:
after the valgrind setup, there are so many other things which are done
that by the time we actually use the Git binaries, everything should be
okay.
And keep in mind, this _only_ matters if you do make -j _and_ you haven't
run --valgrind _ever_. Once the symlinks are there, they are there.
(Actually, with my new patch, the may be replaced, but _only_ if
necessary, and the same thing would apply as I said earlier: the binary
would not be found, or a binary from the PATH would be run without
valgrind; but the next runs will not have the problem.)
> > However, the symlink creation is not checked for success, so the
> > processes will still both run just fine.
>
> Yes, so there is no race in what is there currently. It's just sad that
> we can't detect any actual errors.
Now we can. I actually check for the correct link target now (which means
I also check for a link), and if it is incorrect, the link is recreated
(and the deletion is checked for errors).
> > There is a very subtle problem, though. If you screw with your
> > configuration, replacing a link in t/valgrind/ by a script, my code
> > will not try to undo it. However, I think that's really asking for
> > trouble, and you can get out of the mess by "rm -r t/valgrind/git*".
>
> I think we can safely ignore such mucking about in the valgrind
> directory as craziness.
You'll find that v2 copes with that, too.
> > Another problem which is potentially much more troublesome is this:
> > when there was a script by a certain name, my code would symlink it to
> > $GIT_DIR/$BASENAME (actually a relative path, but you get the idea).
> > If that script is turned into a builtin -- this list has certainly
> > known a certain person to push for that kind of conversion :-) -- that
> > fact is not picked up.
>
> Yes. One way around this is to generate a "want" and a "have" list, and
> then just operate on the differences. Something like (totally untested):
>
> (cd $GIT_VALGRIND && ls) | sort >have
> (cd $TEST_DIRECTORY/.. && ls git git-*) | sort >want
> comm -23 have want | xargs -r rm -v
> comm -13 have want | while read f; do ln -s ../../$f $GIT_VALGRIND/$f; done
>
> and then you are also cleaning every time you create.
The script will now pick up on those changes, and recreate the symlink
correctly.
We don't need cleaning, as we only link to $TEST_DIRECTORY/.. (at least
via valgrind.sh), and if the binary does not exist there, well, it does
not exist there, and the script will error out, saying so.
Ciao,
Dscho
next prev parent reply other threads:[~2009-01-21 1:28 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-19 9:13 What's cooking in git.git (Jan 2009, #04; Mon, 19) Junio C Hamano
2009-01-19 11:54 ` Kjetil Barvik
2009-01-19 13:09 ` Johannes Schindelin
2009-01-19 13:08 ` Johannes Schindelin
2009-01-20 4:44 ` Jeff King
2009-01-20 13:51 ` valgrind patches, was " Johannes Schindelin
2009-01-20 14:19 ` Jeff King
2009-01-20 14:50 ` Johannes Schindelin
2009-01-20 15:04 ` [PATCH 1/2] Add valgrind support in test scripts Johannes Schindelin
2009-01-20 15:05 ` [PATCH 2/2] valgrind: ignore ldso errors Johannes Schindelin
2009-01-21 0:12 ` [PATCH 1/2] Add valgrind support in test scripts Jeff King
2009-01-21 0:41 ` Johannes Schindelin
2009-01-21 1:10 ` [PATCH 1/2 v2] " Johannes Schindelin
2009-01-21 1:11 ` [INTERDIFF of PATCH " Johannes Schindelin
2009-01-21 8:48 ` [PATCH " Junio C Hamano
2009-01-21 12:21 ` Johannes Schindelin
2009-01-21 19:02 ` Jeff King
2009-01-21 20:49 ` Johannes Schindelin
2009-01-21 21:53 ` Jeff King
2009-01-21 22:38 ` Johannes Schindelin
2009-01-25 23:18 ` [PATCH 0/3] Valgrind support Johannes Schindelin
2009-01-25 23:18 ` [PATCH v3 1/3] Add valgrind support in test scripts Johannes Schindelin
2009-01-25 23:29 ` Jeff King
2009-01-25 23:35 ` Johannes Schindelin
2009-01-25 23:42 ` Jeff King
2009-01-25 23:19 ` [PATCH v3 2/3] valgrind: ignore ldso and more libz errors Johannes Schindelin
2009-01-25 23:32 ` Jeff King
2009-01-26 0:02 ` Johannes Schindelin
2009-01-26 0:14 ` Jeff King
2009-01-25 23:20 ` [PATCH 3/3] Valgrind support: check for more than just programming errors Johannes Schindelin
2009-01-25 23:42 ` Jeff King
2009-01-26 0:43 ` Johannes Schindelin
2009-01-21 22:31 ` [PATCH] valgrind tests: be super-super paranoid when creating symlinks Johannes Schindelin
2009-01-20 23:24 ` valgrind patches, was Re: What's cooking in git.git (Jan 2009, #04; Mon, 19) Jeff King
2009-01-21 0:10 ` Johannes Schindelin
2009-01-21 0:15 ` Jeff King
2009-01-21 0:28 ` Johannes Schindelin
2009-01-21 0:37 ` Jeff King
2009-01-21 1:26 ` Johannes Schindelin [this message]
2009-01-21 1:36 ` [PATCH 2/2 v2] valgrind: ignore ldso errors Johannes Schindelin
2009-01-21 19:09 ` Jeff King
2009-01-21 20:51 ` Johannes Schindelin
2009-01-21 19:07 ` valgrind patches, was Re: What's cooking in git.git (Jan 2009, #04; Mon, 19) Jeff King
2009-01-21 22:17 ` Johannes Schindelin
2009-01-21 23:57 ` Jeff King
2009-01-22 0:42 ` Junio C Hamano
2009-01-22 0:59 ` Jeff King
2009-01-22 5:02 ` Johannes Schindelin
2009-01-22 5:39 ` Jeff King
2009-01-27 2:50 ` Valgrind updates Johannes Schindelin
2009-01-27 3:38 ` Linus Torvalds
2009-01-27 4:26 ` Johannes Schindelin
2009-01-27 4:46 ` Johannes Schindelin
2009-01-27 13:14 ` Mark Brown
2009-01-27 16:54 ` Johannes Schindelin
2009-01-27 18:55 ` Linus Torvalds
2009-01-27 21:52 ` Johannes Schindelin
2009-01-29 1:56 ` Linus Torvalds
2009-01-29 14:22 ` Johannes Schindelin
2009-01-28 23:06 ` Mark Adler
2009-01-28 23:27 ` Johannes Schindelin
2009-01-29 0:15 ` Mark Adler
2009-01-29 14:14 ` Johannes Schindelin
2009-01-29 14:54 ` Johannes Schindelin
2009-01-27 4:48 ` Jeff King
2009-01-27 9:31 ` Johannes Schindelin
2009-01-20 4:30 ` What's cooking in git.git (Jan 2009, #04; Mon, 19) Jeff King
2009-01-20 4:40 ` Jeff King
2009-01-20 7:04 ` Junio C Hamano
2009-01-20 7:55 ` Johannes Sixt
2009-01-20 14:18 ` Jeff King
2009-01-20 5:17 ` Boyd Stephen Smith Jr.
2009-01-20 8:57 ` Thomas Rast
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=alpine.DEB.1.00.0901210216440.19014@racer \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/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