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

[PATCH 0/3] fixes for running the test suite with --valgrind

From
Thomas Gummerer <t.gummerer@gmail.com>
Date
Oct 3, 2017, 19:57 UTC
Message-ID
<20171003195713.13395-1-t.gummerer@gmail.com>

I recently tried to run the git test suite with --valgrind. Unfortunately it didn't come back completely clean. This patch series fixes a bunch of these errors, although unfortunately not quite all of them yet.

The remaining failures are in

t0021.15 - This one is not actually valgrind complaining about something, but the clean/smudge script not writing debug.log for some reason. I'm not quite sure what exactly is going on here. t0021.25, t0021.26 - This is an actual uninitialized memory usage:

==4751== Conditional jump or move depends on uninitialised value(s) ==4751== at 0x2796D5: fill_stat_cache_info (read-cache.c:153) ==4751== by 0x2218A2: write_entry (entry.c:359) ==4751== by 0x221D42: checkout_entry (entry.c:458) ==4751== by 0x2EB627: check_updates (unpack-trees.c:382) ==4751== by 0x2EDBA1: unpack_trees (unpack-trees.c:1380) ==4751== by 0x13797E: checkout (clone.c:750) ==4751== by 0x138FF4: cmd_clone (clone.c:1194) ==4751== by 0x11A6F2: run_builtin (git.c:342) ==4751== by 0x11A9E8: handle_builtin (git.c:550) ==4751== by 0x11ABCC: run_argv (git.c:602) ==4751== by 0x11AD8E: cmd_main (git.c:679) ==4751== by 0x1BF125: main (common-main.c:43) ==4751== Uninitialised value was created by a stack allocation ==4751== at 0x2212B4: write_entry (entry.c:254) ==4751==

So far I've tracked this one down to the lstat call in write_entry failing, and thus not filling struct stat_info. I'm not quite sure yet about the best workaround for that (and I'm not very familiar with the clean/smudge code). I'll keep digging what the problem there is.

There's also one test that's unexpectedly passing when the test suite is run under valgrind (t6410.) but I haven't dug into what's up with that yet.

These patches could be applied by themselves as well, but since they work toward the same goal, and a cover letter would explain where these are coming from I decided to make them into a patch series.

Thomas Gummerer (3):
  path.c: fix uninitialized memory access
  http-push: fix construction of hex value from path
  sub-process: allocate argv on the heap
 http-push.c   |  2 +-
 path.c        | 19 ++++++++++---------
 sub-process.c |  4 +++-
 3 files changed, 14 insertions(+), 11 deletions(-)
-- 
2.14.1.480.gb18f417b89
Next: Thomas Gummerer
Message 1 of 30 in “fixes for running the test suite with --valgrind”
  1. 0/3 fixes for running the test suite with --valgrindThomas Gummerer, Oct 3, 2017
  2. 1/3 path.c: fix uninitialized memory accessThomas Gummerer, Oct 3, 2017
  3. Jonathan NiederOct 3, 2017
  4. Jeff KingOct 3, 2017
  5. Jonathan NiederOct 3, 2017
  6. Junio C HamanoOct 4, 2017
  7. Jeff KingOct 4, 2017
  8. Thomas GummererOct 4, 2017
  9. Jonathan NiederOct 4, 2017
  10. 2/3 http-push: fix construction of hex value from pathThomas Gummerer, Oct 3, 2017
  11. Jonathan NiederOct 3, 2017
  12. Jeff KingOct 3, 2017
  13. Junio C HamanoOct 4, 2017
  14. Junio C HamanoOct 4, 2017
  15. Jeff KingOct 4, 2017
  16. Junio C HamanoOct 4, 2017
  17. 3/3 sub-process: allocate argv on the heapThomas Gummerer, Oct 3, 2017
  18. Johannes SixtOct 3, 2017
  19. Junio C HamanoOct 4, 2017
  20. Jeff KingOct 4, 2017
  21. Johannes SixtOct 4, 2017
  22. Thomas GummererOct 4, 2017
  23. Stefan BellerOct 3, 2017
  24. Jeff KingOct 3, 2017
  25. Jonathan NiederOct 3, 2017
  26. Jeff KingOct 3, 2017
  27. playing with MSan, was Re: [PATCH 0/3] fixes for running the test suite with --valgrindJeff King, Oct 4, 2017
  28. Thomas GummererOct 4, 2017
  29. lstat-ing delayed-filter output, was Re: playing with MSanJeff King, Oct 5, 2017
  30. Lars SchneiderOct 5, 2017

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.