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

Re: [RFC PATCH 0/2] alternate hash test

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Jan 28, 2018, 18:32 UTC
Message-ID
<20180128183239.11237-1-szeder.dev@gmail.com>
In-Reply-To
<20180128170639.216397-1-sandals@crustytoothpaste.net>
> This series wires up an alternate hash implementation, namely
> BLAKE2b-160.  The goal is to allow us to identify tests which rely on
> the hash algorithm in use so that we can fix those tests.
> t9903-bash-prompt.sh                             (Wstat: 256 Tests: 66 Failed: 53)
>   Failed tests:  4, 6-10, 14-34, 36, 39-62, 65
>   Non-zero exit status: 1

I didn't recall seeing hardcoded SHA-1s in the bash prompt tests, so went to have a look. And indeed, these failures are not the test's fault, but the result of a segfault in 'git checkout' while trying to return from an orphan branch in test 4. The rest of the failures are mostly fallout caused by the wrong branch being checked out or the leftover index.lock.

$ ./t9903-bash-prompt.sh -v -i
<...>
expecting success: 
      printf " (unborn)" >expected &&
      git checkout --orphan unborn &&
      test_when_finished "git checkout master" &&
      __git_ps1 >"$actual" &&
      test_cmp expected "$actual"

Switched to a new branch 'unborn' ./test-lib.sh: line 609: 29342 Segmentation fault git checkout master not ok 4 - prompt - unborn branch

$ gdb --args ../../git checkout master
<...>
Program received signal SIGSEGV, Segmentation fault.
0x000000000041b636 in merge_working_tree (opts=0x7fffffffd200, 
    old=0x7fffffffd0d0, new=0x7fffffffd1e0,
writeout_error=0x7fffffffd0c0)
    at builtin/checkout.c:525
525                     init_tree_desc(&trees[0], tree->buffer,
tree->size);
(gdb) p tree 
$1 = (struct tree *) 0x0

The root cause is that patch 2/2 misses places where EMPTY_TREE_SHA1_* constants should have been replaced with their EMPTY_TREE_SBLAKE2B_* counterparts.

Previous: brian m. carlsonNext: Ævar Arnfjörð Bjarmason
Message 4 of 9 in “alternate hash test”
  1. 0/2 alternate hash testbrian m. carlson, Jan 28, 2018
  2. 2/2 Switch default hash algorithm to short BLAKE2b for testingbrian m. carlson, Jan 28, 2018
  3. 1/2 Base test implementation for short BLAKE2b supportbrian m. carlson, Jan 28, 2018
  4. SZEDER GáborJan 28, 2018
  5. Ævar Arnfjörð BjarmasonJan 28, 2018
  6. brian m. carlsonJan 28, 2018
  7. Junio C HamanoJan 30, 2018
  8. Stefan BellerJan 31, 2018
  9. brian m. carlsonFeb 1, 2018

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.