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

Re: [PATCH 2/2] test-lib: exhaustively insert non-alnum ASCII into the TRASH_DIRECTORY name

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Apr 10, 2017, 23:23 UTC
Message-ID
<CACBZZX7OfM-zivJAQMXdNarHDjAhzQhqGNZNs2QqDUyOo3AA0g@mail.gmail.com>
In-Reply-To
<20170409191117.25175-3-avarab@gmail.com>

On Sun, Apr 9, 2017 at 9:11 PM, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

> Change the test library to insert non-alphanumeric ASCII characters
> into the TRASH_DIRECTORY name, that's the directory the test library
> creates, chdirs to and runs each individual test from.

I did a bit more work on getting more granularity on why things were failing. I wrote a script[1] that runs each of the failing tests once with each individual character in the non-alphanumeric ASCII range to narrow down issues.

I skipped the svn tests, and something went wrong in the middle of my run to make the http tests fail on everything, but the gist of it is:

* Most of the tests fail because git clone can't deal with cloning a
repo with a \r in the path. The error we produce when we try is quite
bad and doesn't indicate what went wrong:

$ rm -rf /tmp/git.*; mkdir /tmp/git.$(perl -e 'print chr 13') && cd /tmp/git.* && git init --bare b && file b && git clone b c /b/tialized empty Git repository in /tmp/git. b: directory Cloning into 'c'... fatal: '/tmp/git. /b' does not appear to be a git repository fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

So file(1) shows it exists, a strace shows that git knows it exists at some point, but something gets lost along the way.

* Much of it fails due to GIT_CEILING_DIRECTORIES not working with
dirs with ":" in the name.
* That leaves the rest at:

$ grep FAIL results | grep -v -e svn -e svk | awk '{print $1 " " $2}'|perl -nE 'chomp;my ($f, $c) = split / /, $_; push @{$f{$f}} => $c; END { for my $k (sort keys %f) { say "$k = " . join ", ", map { $_ < 32 ? $_ : "$_(" . chr($_) . ")" } @{$f{$k}} } }'|grep -E -v '^.{150,}$'|grep -E -v -e '= 13$' -e '= 58\(:\)$' -e '= 13, 58\(:\)$' t0021-conversion.sh = 37(%), 58(:) t0060-path-utils.sh = 39(') t0302-credential-store.sh = 9, 32( ), 34("), 40((), 39('), 38(&), 41()), 59(;), 60(<), 62(>), 96(`), 124(|) t1305-config-include.sh = 9, 13, 34("), 35(#), 59(;), 92(\), 91([) t1500-rev-parse.sh = 9, 13 t1510-repo-setup.sh = 13, 92(\) t3900-i18n-commit.sh = 9, 32( ), 40((), 41()), 38(&), 59(;), 60(<), 62(>), 124(|) t4030-diff-textconv.sh = 13, 34("), 96(`) t4031-diff-rewrite-binary.sh = 13, 34("), 96(`) t5150-request-pull.sh = 13, 92(\) t5310-pack-bitmaps.sh = 9, 13 t5407-post-rewrite-hook.sh = 34("), 96(`) t5505-remote.sh = 13, 35(#) t5516-fetch-push.sh = 13, 39(') t5601-clone.sh = 13, 34("), 39('), 96(`) t7003-filter-branch.sh = 34("), 96(`) t7008-grep-binary.sh = 13, 34("), 96(`) t7402-submodule-rebase.sh = 13, 34("), 96(`) t7405-submodule-merge.sh = 34("), 92(\) t7406-submodule-update.sh = 13, 9, 34("), 35(#), 38(&), 59(;), 92(\) t7407-submodule-foreach.sh = 13, 9, 42(*) t7504-commit-msg-hook.sh = 34("), 96(`) t7700-repack.sh = 9, 42(*) t9001-send-email.sh = 13, 34("), 96(`) t9200-git-cvsexportcommit.sh = 42(*), 63(?) t9300-fast-import.sh = 34("), 92(\) t9400-git-cvsserver-server.sh = 13, 59(;) t9401-git-cvsserver-crlf.sh = 13, 59(;) t9402-git-cvsserver-refs.sh = 13, 59(;) t9600-cvsimport.sh = 42(*), 58(:), 63(?) t9601-cvsimport-vendor-branch.sh = 42(*), 58(:), 63(?) t9602-cvsimport-branches-tags.sh = 42(*), 63(?), 58(:) t9604-cvsimport-timestamps.sh = 42(*), 58(:), 63(?) t9700-perl-git.sh = 13, 92(\)

I've fixed a few in https://github.com/avar/git/commit/55395613fe
There's one segfault in there:

$ ./t5601-clone.sh --root="xtmp.$(perl -e 'print chr 39')" -v -i -d [...] Cloning into 'ssh-bracket-clone-plink-4'... Segmentation fault not ok 45 - single quoted plink.exe in GIT_SSH_COMMAND

1. https://github.com/avar/git/commit/edc439c462
Previous: SZEDER GáborNext: Jeff King
Message 14 of 25 in “test: Detect *lots* of bugs by adding non-alnum to trash dir names”
  1. 0/2 test: Detect *lots* of bugs by adding non-alnum to trash dir namesÆvar Arnfjörð Bjarmason, Apr 9, 2017
  2. 1/2 tests: mark tests that fail when the TEST_DIRECTORY is unusualÆvar Arnfjörð Bjarmason, Apr 9, 2017
  3. 2/2 test-lib: exhaustively insert non-alnum ASCII into the TRASH_DIRECTORY nameÆvar Arnfjörð Bjarmason, Apr 9, 2017
  4. SZEDER GáborApr 10, 2017
  5. Ævar Arnfjörð BjarmasonApr 10, 2017
  6. SZEDER GáborApr 10, 2017
  7. Ævar Arnfjörð BjarmasonApr 10, 2017
  8. Jeff KingApr 10, 2017
  9. Joachim DurchholzApr 10, 2017
  10. Jeff KingApr 10, 2017
  11. Joachim DurchholzApr 10, 2017
  12. Jeff KingApr 10, 2017
  13. SZEDER GáborApr 10, 2017
  14. Ævar Arnfjörð BjarmasonApr 10, 2017
  15. connect.c: handle errors from split_cmdlineJeff King, Apr 11, 2017
  16. Jeff KingApr 11, 2017
  17. Ævar Arnfjörð BjarmasonApr 11, 2017
  18. Jeff KingApr 11, 2017
  19. Ævar Arnfjörð BjarmasonApr 11, 2017
  20. Junio C HamanoApr 17, 2017
  21. Junio C HamanoApr 17, 2017
  22. Ævar Arnfjörð BjarmasonApr 19, 2017
  23. Jeff KingApr 11, 2017
  24. Joachim DurchholzApr 11, 2017
  25. Joachim DurchholzApr 9, 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.