git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: valgrind patches, was Re: What's cooking in git.git (Jan 2009, #04; Mon, 19)

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 21, 2009, 01:26 UTC
Message-ID
<alpine.DEB.1.00.0901210216440.19014@racer>
In-Reply-To
<20090121003739.GA18373@coredump.intra.peff.net>
Hi,
On Tue, 20 Jan 2009, Jeff King wrote:
Show 12 quoted lines
> 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.)

Show 5 quoted lines
> > 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).

Show 7 quoted lines
> > 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.
Show 16 quoted lines
> > 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

Previous: Jeff KingNext: Johannes Schindelin
Message 39 of 73 in “What's cooking in git.git (Jan 2009, #04; Mon, 19)”
  1. Junio C HamanoJan 19, 2009
  2. Kjetil BarvikJan 19, 2009
  3. Johannes SchindelinJan 19, 2009
  4. Johannes SchindelinJan 19, 2009
  5. Jeff KingJan 20, 2009
  6. valgrind patches, was Re: What's cooking in git.git (Jan 2009, #04; Mon, 19)Johannes Schindelin, Jan 20, 2009
  7. Jeff KingJan 20, 2009
  8. Johannes SchindelinJan 20, 2009
  9. 1/2 Add valgrind support in test scriptsJohannes Schindelin, Jan 20, 2009
  10. 2/2 valgrind: ignore ldso errorsJohannes Schindelin, Jan 20, 2009
  11. Jeff KingJan 21, 2009
  12. Johannes SchindelinJan 21, 2009
  13. 1/2 Add valgrind support in test scriptsJohannes Schindelin, Jan 21, 2009
  14. 1/2 Add valgrind support in test scriptsJohannes Schindelin, Jan 21, 2009
  15. Junio C HamanoJan 21, 2009
  16. Johannes SchindelinJan 21, 2009
  17. Jeff KingJan 21, 2009
  18. Johannes SchindelinJan 21, 2009
  19. Jeff KingJan 21, 2009
  20. Johannes SchindelinJan 21, 2009
  21. 0/3 Valgrind supportJohannes Schindelin, Jan 25, 2009
  22. 1/3 Add valgrind support in test scriptsJohannes Schindelin, Jan 25, 2009
  23. Jeff KingJan 25, 2009
  24. Johannes SchindelinJan 25, 2009
  25. Jeff KingJan 25, 2009
  26. 2/3 valgrind: ignore ldso and more libz errorsJohannes Schindelin, Jan 25, 2009
  27. Jeff KingJan 25, 2009
  28. Johannes SchindelinJan 26, 2009
  29. Jeff KingJan 26, 2009
  30. 3/3 Valgrind support: check for more than just programming errorsJohannes Schindelin, Jan 25, 2009
  31. Jeff KingJan 25, 2009
  32. Johannes SchindelinJan 26, 2009
  33. valgrind tests: be super-super paranoid when creating symlinksJohannes Schindelin, Jan 21, 2009
  34. Jeff KingJan 20, 2009
  35. Johannes SchindelinJan 21, 2009
  36. Jeff KingJan 21, 2009
  37. Johannes SchindelinJan 21, 2009
  38. Jeff KingJan 21, 2009
  39. Johannes SchindelinJan 21, 2009
  40. 2/2 valgrind: ignore ldso errorsJohannes Schindelin, Jan 21, 2009
  41. Jeff KingJan 21, 2009
  42. Johannes SchindelinJan 21, 2009
  43. Jeff KingJan 21, 2009
  44. Johannes SchindelinJan 21, 2009
  45. Jeff KingJan 21, 2009
  46. Junio C HamanoJan 22, 2009
  47. Jeff KingJan 22, 2009
  48. Johannes SchindelinJan 22, 2009
  49. Jeff KingJan 22, 2009
  50. Valgrind updatesJohannes Schindelin, Jan 27, 2009
  51. Linus TorvaldsJan 27, 2009
  52. Johannes SchindelinJan 27, 2009
  53. Johannes SchindelinJan 27, 2009
  54. Mark BrownJan 27, 2009
  55. Johannes SchindelinJan 27, 2009
  56. Linus TorvaldsJan 27, 2009
  57. Johannes SchindelinJan 27, 2009
  58. Linus TorvaldsJan 29, 2009
  59. Johannes SchindelinJan 29, 2009
  60. Mark AdlerJan 28, 2009
  61. Johannes SchindelinJan 28, 2009
  62. Mark AdlerJan 29, 2009
  63. Johannes SchindelinJan 29, 2009
  64. Johannes SchindelinJan 29, 2009
  65. Jeff KingJan 27, 2009
  66. Johannes SchindelinJan 27, 2009
  67. Jeff KingJan 20, 2009
  68. Jeff KingJan 20, 2009
  69. Junio C HamanoJan 20, 2009
  70. Johannes SixtJan 20, 2009
  71. Jeff KingJan 20, 2009
  72. Boyd Stephen Smith Jr.Jan 20, 2009
  73. Thomas RastJan 20, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.