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

Re: [Breakage] Git v2.21.0-rc0 - t5318 (NonStop)

From
Johannes Sixt <j6t@kdbg.org>
Date
Feb 9, 2019, 08:39 UTC
Message-ID
<38f594ed-0787-aeb5-d34f-2f4775243eb7@kdbg.org>
In-Reply-To
<20190209042456.GB18286@sigill.intra.peff.net>
Am 09.02.19 um 05:24 schrieb Jeff King:
Show 21 quoted lines
> On Fri, Feb 08, 2019 at 05:53:53PM -0500, Randall S. Becker wrote:
> 
>>> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index
>>> 92cf8f812c..4afab14431 100644
>>> --- a/t/test-lib-functions.sh
>>> +++ b/t/test-lib-functions.sh
>>> @@ -1302,3 +1302,8 @@ test_set_port () {
>>>  	port=$(($port + ${GIT_TEST_STRESS_JOB_NR:-0}))
>>>  	eval $var=$port
>>>  }
>>> +
>>> +# Generate an output of $1 bytes of all zeroes (NULs, not ASCII zeroes).
>>> +gen_zero_bytes () {
>>> +	perl -e 'print "\0" x $ARGV[0]' "$@"
>>> +}
>>
>> This function does work on platform, so it's good.
> 
> Great. Since it sounds like you're preparing some patches to deal with
> /dev/zero elsewhere, do you want to wrap it up in a patch as part of
> that?

Please do not use yes to generate an infinite amount of bytes. Our implementation of yes() in test-lib.sh generates only 99 lines.

Perhaps do this.
----- 8< -----
Subject: [PATCH] t5318: avoid /dev/zero

Some platforms do not offer /dev/zero. Use printf and tr to generate a certain amount of NUL bytes.

Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t5318-commit-graph.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh
index 16d10ebce8..04d394274f 100755
--- a/t/t5318-commit-graph.sh
+++ b/t/t5318-commit-graph.sh
@@ -383,7 +383,8 @@ corrupt_graph_and_verify() {
 	cp $objdir/info/commit-graph commit-graph-backup &&
 	printf "$data" | dd of="$objdir/info/commit-graph" bs=1 seek="$pos" conv=notrunc &&
 	dd of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" count=0 &&
-	dd if=/dev/zero of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" count=$(($orig_size - $zero_pos)) &&
+	printf "%0*d" $(($orig_size - $zero_pos)) 0 | tr 0 '\0' |
+		dd of="$objdir/info/commit-graph" bs=1 seek="$zero_pos" &&
 	test_must_fail git commit-graph verify 2>test_err &&
 	grep -v "^+" test_err >err &&
 	test_i18ngrep "$grepstr" err
-- 
2.20.1.86.gb0de946387
Previous: Jeff KingNext: Randall S. Becker
Message 21 of 25 in “[Breakage] Git v2.21.0-rc0 - t5318 (NonStop)”
  1. Randall S. BeckerFeb 8, 2019
  2. Jeff KingFeb 8, 2019
  3. Randall S. BeckerFeb 8, 2019
  4. Jeff KingFeb 8, 2019
  5. Johannes SixtFeb 8, 2019
  6. Junio C HamanoFeb 8, 2019
  7. Randall S. BeckerFeb 8, 2019
  8. Jeff KingFeb 8, 2019
  9. Randall S. BeckerFeb 8, 2019
  10. Jeff KingFeb 8, 2019
  11. Randall S. BeckerFeb 8, 2019
  12. Jeff KingFeb 8, 2019
  13. Randall S. BeckerFeb 8, 2019
  14. brian m. carlsonFeb 8, 2019
  15. Randall S. BeckerFeb 8, 2019
  16. brian m. carlsonFeb 8, 2019
  17. Randall S. BeckerFeb 8, 2019
  18. Jeff KingFeb 8, 2019
  19. Randall S. BeckerFeb 8, 2019
  20. Jeff KingFeb 9, 2019
  21. Johannes SixtFeb 9, 2019
  22. Randall S. BeckerFeb 9, 2019
  23. Jeff KingFeb 9, 2019
  24. Johannes SixtFeb 10, 2019
  25. Randall S. BeckerFeb 9, 2019

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.