{"thread":{"id":"50450","subject":"[Patch v1 1/3] test-lib-functions.sh: add generate_zero_bytes function","startedAt":"2019-02-09T18:59:46Z","lastAt":"2019-02-15T18:45:55Z","messageCount":24,"participants":["randall.s.becker@rogers.com","Eric Sunshine","Randall S. Becker","Jeff King","Junio C Hamano","Johannes Sixt","Max Kirillov"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"368934","messageId":"20190209185930.5256-2-randall.s.becker@rogers.com","threadId":"50450","inReplyTo":"20190209185930.5256-1-randall.s.becker@rogers.com","subject":"[Patch v1 1/3] test-lib-functions.sh: add generate_zero_bytes function","fromName":"","fromEmail":"randall.s.becker@rogers.com","sentAt":"2019-02-09T18:59:28Z","receivedAt":"2019-02-09T18:59:46Z","isPatch":true,"sender":{"key":"randall.s.becker@rogers.com","avatar":null},"body":"From: \"Randall S. Becker\" <rsbecker@nexbridge.com>\n\nt5318 and t5562 used /dev/zero, which is not portable. This function\nprovides both a fixed block of NUL bytes and an infinite stream of NULs.\n\nSigned-off-by: Randall S. Becker <rsbecker@nexbridge.com>\n---\n t/test-lib-functions.sh | 13 +++++++++++++\n 1 file changed, 13 insertions(+)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 92cf8f812..bbf68712c 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -116,6 +116,19 @@ remove_cr () {\n \ttr '\\015' Q | sed -e 's/Q$//'\n }\n \n+# Generate an output of $1 bytes of all zeroes (NULs, not ASCII zeroes).\n+# If $1 is 'infinity', output forever or until the receiving pipe stops reading,\n+# whichever comes first.\n+generate_zero_bytes () {\n+\tperl -e 'if ($ARGV[0] == \"infinity\") {\n+\t\twhile (-1) {\n+\t\t\tprint \"\\0\"\n+\t\t}\n+\t} else {\n+\t\tprint \"\\0\" x $ARGV[0]\n+\t}' \"$@\"\n+}\n+\n # In some bourne shell implementations, the \"unset\" builtin returns\n # nonzero status when a variable to be unset was not set in the first\n # place.\n-- \n2.12.3\n\n"},{"id":"368935","messageId":"20190209185930.5256-4-randall.s.becker@rogers.com","threadId":"50450","inReplyTo":"20190209185930.5256-1-randall.s.becker@rogers.com","subject":"[Patch v1 3/3] t5562: replace /dev/zero with a pipe from generate_zero_bytes","fromName":"","fromEmail":"randall.s.becker@rogers.com","sentAt":"2019-02-09T18:59:30Z","receivedAt":"2019-02-09T18:59:48Z","isPatch":true,"sender":{"key":"randall.s.becker@rogers.com","avatar":null},"body":"From: \"Randall S. Becker\" <rsbecker@nexbridge.com>\n\nThis change removes the dependency on /dev/zero with an equivalent  pipe of\ndeliberately NUL bytes. This allows tests to proceed where /dev/zero\ndoes not exist.\n\nSigned-off-by: Randall S. Becker <rsbecker@nexbridge.com>\n---\n t/t5562-http-backend-content-length.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh\nindex 90d890d02..bbadde2c6 100755\n--- a/t/t5562-http-backend-content-length.sh\n+++ b/t/t5562-http-backend-content-length.sh\n@@ -143,14 +143,14 @@ test_expect_success GZIP 'push gzipped empty' '\n \n test_expect_success 'CONTENT_LENGTH overflow ssite_t' '\n \tNOT_FIT_IN_SSIZE=$(ssize_b100dots) &&\n-\tenv \\\n+\tgenerate_zero_bytes infinity  | env \\\n \t\tCONTENT_TYPE=application/x-git-upload-pack-request \\\n \t\tQUERY_STRING=/repo.git/git-upload-pack \\\n \t\tPATH_TRANSLATED=\"$PWD\"/.git/git-upload-pack \\\n \t\tGIT_HTTP_EXPORT_ALL=TRUE \\\n \t\tREQUEST_METHOD=POST \\\n \t\tCONTENT_LENGTH=\"$NOT_FIT_IN_SSIZE\" \\\n-\t\tgit http-backend </dev/zero >/dev/null 2>err &&\n+\t\tgit http-backend >/dev/null 2>err &&\n \tgrep \"fatal:.*CONTENT_LENGTH\" err\n '\n \n-- \n2.12.3\n\n"},{"id":"368936","messageId":"20190209185930.5256-1-randall.s.becker@rogers.com","threadId":"50450","inReplyTo":null,"subject":"[Patch v1 0/3] 2.21.0-rc0 test fixes resulting from use of /dev/zero","fromName":"","fromEmail":"randall.s.becker@rogers.com","sentAt":"2019-02-09T18:59:27Z","receivedAt":"2019-02-09T18:59:50Z","isPatch":true,"sender":{"key":"randall.s.becker@rogers.com","avatar":null},"body":"From: \"Randall S. Becker\" <randall.becker@nexbridge.ca>\n\nThis is a candidate packages of fixes to remove dependence on /dev/zero\nand replaces it with the generate_zero_bytes function in test-lib-functions.sh\n\nRandall S. Becker (3):\n  test-lib-functions.sh: add generate_zero_bytes function\n  t5318: replace use of /dev/zero with generate_zero_bytes\n  t5562: replace /dev/zero with a pipe from generate_zero_bytes\n\n t/t5318-commit-graph.sh                |  2 +-\n t/t5562-http-backend-content-length.sh |  4 ++--\n t/test-lib-functions.sh                | 13 +++++++++++++\n 3 files changed, 16 insertions(+), 3 deletions(-)\n\n-- \n2.12.3\n\n"},{"id":"368937","messageId":"20190209185930.5256-3-randall.s.becker@rogers.com","threadId":"50450","inReplyTo":"20190209185930.5256-1-randall.s.becker@rogers.com","subject":"[Patch v1 2/3] t5318: replace use of /dev/zero with generate_zero_bytes","fromName":"","fromEmail":"randall.s.becker@rogers.com","sentAt":"2019-02-09T18:59:29Z","receivedAt":"2019-02-09T18:59:50Z","isPatch":true,"sender":{"key":"randall.s.becker@rogers.com","avatar":null},"body":"From: \"Randall S. Becker\" <rsbecker@nexbridge.com>\n\nThis change removes the dependency on /dev/zero with generate_zero_bytes\nappending NUL values to blocks generating wrong signatures for test cases.\n\nSigned-off-by: Randall S. Becker <rsbecker@nexbridge.com>\n---\n t/t5318-commit-graph.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh\nindex 16d10ebce..65c1f45b0 100755\n--- a/t/t5318-commit-graph.sh\n+++ b/t/t5318-commit-graph.sh\n@@ -383,7 +383,7 @@ corrupt_graph_and_verify() {\n \tcp $objdir/info/commit-graph commit-graph-backup &&\n \tprintf \"$data\" | dd of=\"$objdir/info/commit-graph\" bs=1 seek=\"$pos\" conv=notrunc &&\n \tdd of=\"$objdir/info/commit-graph\" bs=1 seek=\"$zero_pos\" count=0 &&\n-\tdd if=/dev/zero of=\"$objdir/info/commit-graph\" bs=1 seek=\"$zero_pos\" count=$(($orig_size - $zero_pos)) &&\n+\tgenerate_zero_bytes $(($orig_size - $zero_pos)) >> \"$objdir/info/commit-graph\" &&\n \ttest_must_fail git commit-graph verify 2>test_err &&\n \tgrep -v \"^+\" test_err >err &&\n \ttest_i18ngrep \"$grepstr\" err\n-- \n2.12.3\n\n"},{"id":"368953","messageId":"CAPig+cRARdkKN-wR4EzVSzxuK51VOPf-kFFG57kkEsnFBfe4TA@mail.gmail.com","threadId":"50450","inReplyTo":"20190209185930.5256-2-randall.s.becker@rogers.com","subject":"Re: [Patch v1 1/3] test-lib-functions.sh: add generate_zero_bytes function","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2019-02-10T02:05:04Z","receivedAt":"2019-02-10T02:06:45Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Feb 9, 2019 at 1:59 PM <randall.s.becker@rogers.com> wrote:\n> t5318 and t5562 used /dev/zero, which is not portable. This function\n> provides both a fixed block of NUL bytes and an infinite stream of NULs.\n>\n> Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>\n> ---\n> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\n> @@ -116,6 +116,19 @@ remove_cr () {\n> +# Generate an output of $1 bytes of all zeroes (NULs, not ASCII zeroes).\n> +# If $1 is 'infinity', output forever or until the receiving pipe stops reading,\n> +# whichever comes first.\n\nThis is a somewhat unusual API. A (perhaps) more intuitive behavior\nwould be for it to emit an infinite stream of NULs when given no\nargument, and a limited number of NULs when given an argument.\nRedefining the behavior like that also fixes the \"problem\" with the\ncurrent implementation erroring-out if no argument is provided.\n\n> +generate_zero_bytes () {\n> +       perl -e 'if ($ARGV[0] == \"infinity\") {\n\ns/perl/\"$PERL_PATH\"/\n\n> +               while (-1) {\n> +                       print \"\\0\"\n> +               }\n\nOr, more compactly:\n\n    print \"\\0\" while 1;\n\n> +       } else {\n> +               print \"\\0\" x $ARGV[0]\n> +       }' \"$@\"\n> +}\n"},{"id":"368954","messageId":"CAPig+cTMoYMmnHVuay_4RGr_FN-HWC1tN4TPDsNM4vKCH3GzXw@mail.gmail.com","threadId":"50450","inReplyTo":"20190209185930.5256-3-randall.s.becker@rogers.com","subject":"Re: [Patch v1 2/3] t5318: replace use of /dev/zero with generate_zero_bytes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2019-02-10T02:07:47Z","receivedAt":"2019-02-10T02:07:59Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Feb 9, 2019 at 2:00 PM <randall.s.becker@rogers.com> wrote:\n> This change removes the dependency on /dev/zero with generate_zero_bytes\n> appending NUL values to blocks generating wrong signatures for test cases.\n\nThis commit message says what the patch does but not _why_. At\nminimum, it should explain that /dev/zero is not available on all\nplatforms, therefore, not portable, and (perhaps) cite NonStop as an\nexample.\n\n> Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>\n> ---\n> diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh\n> @@ -383,7 +383,7 @@ corrupt_graph_and_verify() {\n> -       dd if=/dev/zero of=\"$objdir/info/commit-graph\" bs=1 seek=\"$zero_pos\" count=$(($orig_size - $zero_pos)) &&\n> +       generate_zero_bytes $(($orig_size - $zero_pos)) >> \"$objdir/info/commit-graph\" &&\n"},{"id":"368955","messageId":"CAPig+cQY57w9rmGzVifKMTMVwt209b959iL9+K79AMfEgiVTfg@mail.gmail.com","threadId":"50450","inReplyTo":"20190209185930.5256-4-randall.s.becker@rogers.com","subject":"Re: [Patch v1 3/3] t5562: replace /dev/zero with a pipe from generate_zero_bytes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2019-02-10T02:12:21Z","receivedAt":"2019-02-10T02:12:33Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sat, Feb 9, 2019 at 1:59 PM <randall.s.becker@rogers.com> wrote:\n> This change removes the dependency on /dev/zero with an equivalent  pipe of\n\nToo many spaces between \"equivalent\" and \"pipe\".\n\n> deliberately NUL bytes. This allows tests to proceed where /dev/zero\n> does not exist.\n\nIt wouldn't hurt to cite \"NonStop\" as an example of a platform lacking\n/dev/zero.\n\nThe first sentence is a bit off grammatically. Perhaps the entire\ncommit message can be collapsed simply to:\n\n    Stop depending on /dev/zero which may not be available on all\n    platforms (for instance, HP NonStop).\n\n> Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>\n> ---\n> diff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh\n> @@ -143,14 +143,14 @@ test_expect_success GZIP 'push gzipped empty' '\n>  test_expect_success 'CONTENT_LENGTH overflow ssite_t' '\n>         NOT_FIT_IN_SSIZE=$(ssize_b100dots) &&\n> -       env \\\n> +       generate_zero_bytes infinity  | env \\\n>                 CONTENT_TYPE=application/x-git-upload-pack-request \\\n>                 QUERY_STRING=/repo.git/git-upload-pack \\\n>                 PATH_TRANSLATED=\"$PWD\"/.git/git-upload-pack \\\n>                 GIT_HTTP_EXPORT_ALL=TRUE \\\n>                 REQUEST_METHOD=POST \\\n>                 CONTENT_LENGTH=\"$NOT_FIT_IN_SSIZE\" \\\n> -               git http-backend </dev/zero >/dev/null 2>err &&\n> +               git http-backend >/dev/null 2>err &&\n>         grep \"fatal:.*CONTENT_LENGTH\" err\n>  '\n"},{"id":"368983","messageId":"001201d4c175$88aa8d00$99ffa700$@nexbridge.com","threadId":"50450","inReplyTo":"CAPig+cRARdkKN-wR4EzVSzxuK51VOPf-kFFG57kkEsnFBfe4TA@mail.gmail.com","subject":"RE: [Patch v1 1/3] test-lib-functions.sh: add generate_zero_bytes function","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2019-02-10T19:19:19Z","receivedAt":"2019-02-10T19:20:40Z","isPatch":true,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On February 9, 2019 21:05, Eric Sunshine wrote:\n> On Sat, Feb 9, 2019 at 1:59 PM <randall.s.becker@rogers.com> wrote:\n> > t5318 and t5562 used /dev/zero, which is not portable. This function\n> > provides both a fixed block of NUL bytes and an infinite stream of NULs.\n> >\n> > Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>\n> > ---\n> > diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh @@\n> > -116,6 +116,19 @@ remove_cr () {\n> > +# Generate an output of $1 bytes of all zeroes (NULs, not ASCII zeroes).\n> > +# If $1 is 'infinity', output forever or until the receiving pipe\n> > +stops reading, # whichever comes first.\n> \n> This is a somewhat unusual API. A (perhaps) more intuitive behavior would be\n> for it to emit an infinite stream of NULs when given no argument, and a\n> limited number of NULs when given an argument.\n> Redefining the behavior like that also fixes the \"problem\" with the current\n> implementation erroring-out if no argument is provided.\n\nAt this point, I've supplied three different ways to solve this incompatibility for platforms not Linux and others have also provided fixes and discussed this at length. It is not a specific fix that matters to me, but that there is a fix at all. So thanks for all your comments and I will wait on direction on what the team wants me to do about it, if anything.\n\nRegards,\nRandall\n\n"},{"id":"369074","messageId":"20190212003735.GH13301@sigill.intra.peff.net","threadId":"50450","inReplyTo":"CAPig+cRARdkKN-wR4EzVSzxuK51VOPf-kFFG57kkEsnFBfe4TA@mail.gmail.com","subject":"Re: [Patch v1 1/3] test-lib-functions.sh: add generate_zero_bytes function","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-02-12T00:37:35Z","receivedAt":"2019-02-12T00:37:39Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Feb 09, 2019 at 09:05:04PM -0500, Eric Sunshine wrote:\n\n> On Sat, Feb 9, 2019 at 1:59 PM <randall.s.becker@rogers.com> wrote:\n> > t5318 and t5562 used /dev/zero, which is not portable. This function\n> > provides both a fixed block of NUL bytes and an infinite stream of NULs.\n> >\n> > Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>\n> > ---\n> > diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\n> > @@ -116,6 +116,19 @@ remove_cr () {\n> > +# Generate an output of $1 bytes of all zeroes (NULs, not ASCII zeroes).\n> > +# If $1 is 'infinity', output forever or until the receiving pipe stops reading,\n> > +# whichever comes first.\n> \n> This is a somewhat unusual API. A (perhaps) more intuitive behavior\n> would be for it to emit an infinite stream of NULs when given no\n> argument, and a limited number of NULs when given an argument.\n> Redefining the behavior like that also fixes the \"problem\" with the\n> current implementation erroring-out if no argument is provided.\n\nYeah, I agree that'd be a little more idiomatic for our code base, but\nI'm fine with it either way.\n\n> > +generate_zero_bytes () {\n> > +       perl -e 'if ($ARGV[0] == \"infinity\") {\n> \n> s/perl/\"$PERL_PATH\"/\n\nThis shouldn't be necessary. perl() is a function that uses $PERL_PATH\n(so you only need $PERL_PATH when you're writing out another script that\ndoesn't run in the same process space as the rest of the test code).\n\n-Peff\n"},{"id":"369079","messageId":"CAPig+cQwh8RxVLgbBXR2WtE+k-aFAWnr12nBcTPzccQp_gdEZw@mail.gmail.com","threadId":"50450","inReplyTo":"20190212003735.GH13301@sigill.intra.peff.net","subject":"Re: [Patch v1 1/3] test-lib-functions.sh: add generate_zero_bytes function","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2019-02-12T01:17:43Z","receivedAt":"2019-02-12T01:17:58Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Feb 11, 2019 at 7:37 PM Jeff King <peff@peff.net> wrote:\n> On Sat, Feb 09, 2019 at 09:05:04PM -0500, Eric Sunshine wrote:\n> > On Sat, Feb 9, 2019 at 1:59 PM <randall.s.becker@rogers.com> wrote:\n> > > +generate_zero_bytes () {\n> > > +       perl -e 'if ($ARGV[0] == \"infinity\") {\n> >\n> > s/perl/\"$PERL_PATH\"/\n>\n> This shouldn't be necessary. perl() is a function that uses $PERL_PATH\n> (so you only need $PERL_PATH when you're writing out another script that\n> doesn't run in the same process space as the rest of the test code).\n\nThanks for clarifying. I either didn't know or forgot about that.\n"},{"id":"369117","messageId":"001201d4c27d$4980b7e0$dc8227a0$@rogers.com","threadId":"50450","inReplyTo":"CAPig+cQwh8RxVLgbBXR2WtE+k-aFAWnr12nBcTPzccQp_gdEZw@mail.gmail.com","subject":"RE: [Patch v1 1/3] test-lib-functions.sh: add generate_zero_bytes function","fromName":"","fromEmail":"randall.s.becker@rogers.com","sentAt":"2019-02-12T02:47:25Z","receivedAt":"2019-02-12T02:47:31Z","isPatch":true,"sender":{"key":"randall.s.becker@rogers.com","avatar":null},"body":"On February 11, 2019 20:18, Eric Sunshine wrote:\n> On Mon, Feb 11, 2019 at 7:37 PM Jeff King <peff@peff.net> wrote:\n> > On Sat, Feb 09, 2019 at 09:05:04PM -0500, Eric Sunshine wrote:\n> > > On Sat, Feb 9, 2019 at 1:59 PM <randall.s.becker@rogers.com> wrote:\n> > > > +generate_zero_bytes () {\n> > > > +       perl -e 'if ($ARGV[0] == \"infinity\") {\n> > >\n> > > s/perl/\"$PERL_PATH\"/\n> >\n> > This shouldn't be necessary. perl() is a function that uses $PERL_PATH\n> > (so you only need $PERL_PATH when you're writing out another script\n> > that doesn't run in the same process space as the rest of the test code).\n> \n> Thanks for clarifying. I either didn't know or forgot about that.\n\nAs did I, thank you.\n\n"},{"id":"369169","messageId":"xmqqh8d9diy8.fsf@gitster-ct.c.googlers.com","threadId":"50450","inReplyTo":"CAPig+cTMoYMmnHVuay_4RGr_FN-HWC1tN4TPDsNM4vKCH3GzXw@mail.gmail.com","subject":"Re: [Patch v1 2/3] t5318: replace use of /dev/zero with generate_zero_bytes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-02-12T17:18:07Z","receivedAt":"2019-02-12T17:18:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> On Sat, Feb 9, 2019 at 2:00 PM <randall.s.becker@rogers.com> wrote:\n>> This change removes the dependency on /dev/zero with generate_zero_bytes\n>> appending NUL values to blocks generating wrong signatures for test cases.\n>\n> This commit message says what the patch does but not _why_. At\n> minimum, it should explain that /dev/zero is not available on all\n> platforms, therefore, not portable, and (perhaps) cite NonStop as an\n> example.\n\nDoes sombody want to do the honors?  [PATCH 1/3] would become wasted\neffort until that happens.  On the other hand, if this is not urgent\n(it is only urgent for those without /dev/zero, and to others it may\nbe distraction/disruption this close to the final release to add\nincreased risk of fat finger mistakes), obviously I can wait.\n\n>> Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>\n>> ---\n>> diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh\n>> @@ -383,7 +383,7 @@ corrupt_graph_and_verify() {\n>> -       dd if=/dev/zero of=\"$objdir/info/commit-graph\" bs=1 seek=\"$zero_pos\" count=$(($orig_size - $zero_pos)) &&\n>> +       generate_zero_bytes $(($orig_size - $zero_pos)) >> \"$objdir/info/commit-graph\" &&\n\nThe original says \"skip to the $zero_pos location in an existing\ninfo/commit-graph file, and overwrite its existing contents up to\nthe $orig_size location with NULs\".\n\nIf I recall the implementation of generate_zero_bytes in [PATCH 1/3]\ncorrectly, it just generated stream of NULs of given number of bytes.\n\nThe only reason why this rewrite is not wrong is because the\nprevious line (omitted in your quote) truncates the file to\n$zero_pos.  That is a bit tricky ;-).\n"},{"id":"369171","messageId":"xmqqd0nwex7w.fsf@gitster-ct.c.googlers.com","threadId":"50450","inReplyTo":"CAPig+cQY57w9rmGzVifKMTMVwt209b959iL9+K79AMfEgiVTfg@mail.gmail.com","subject":"Re: [Patch v1 3/3] t5562: replace /dev/zero with a pipe from generate_zero_bytes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-02-12T17:24:35Z","receivedAt":"2019-02-12T17:24:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n[jc: Summoning Dscho, J6t for their Windows expertise at the end]\n\n> On Sat, Feb 9, 2019 at 1:59 PM <randall.s.becker@rogers.com> wrote:\n>> This change removes the dependency on /dev/zero with an equivalent  pipe of\n>\n> Too many spaces between \"equivalent\" and \"pipe\".\n>\n>> deliberately NUL bytes. This allows tests to proceed where /dev/zero\n>> does not exist.\n>\n> It wouldn't hurt to cite \"NonStop\" as an example of a platform lacking\n> /dev/zero.\n>\n> The first sentence is a bit off grammatically. Perhaps the entire\n> commit message can be collapsed simply to:\n>\n>     Stop depending on /dev/zero which may not be available on all\n>     platforms (for instance, HP NonStop).\n>\n>> Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>\n>> ---\n>> diff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh\n>> @@ -143,14 +143,14 @@ test_expect_success GZIP 'push gzipped empty' '\n>>  test_expect_success 'CONTENT_LENGTH overflow ssite_t' '\n>>         NOT_FIT_IN_SSIZE=$(ssize_b100dots) &&\n>> -       env \\\n>> +       generate_zero_bytes infinity  | env \\\n>>                 CONTENT_TYPE=application/x-git-upload-pack-request \\\n>>                 QUERY_STRING=/repo.git/git-upload-pack \\\n>>                 PATH_TRANSLATED=\"$PWD\"/.git/git-upload-pack \\\n>>                 GIT_HTTP_EXPORT_ALL=TRUE \\\n>>                 REQUEST_METHOD=POST \\\n>>                 CONTENT_LENGTH=\"$NOT_FIT_IN_SSIZE\" \\\n>> -               git http-backend </dev/zero >/dev/null 2>err &&\n>> +               git http-backend >/dev/null 2>err &&\n\nDoesn't this \"inifinity\" mode have the same issue that was worked\naround by 6129c930 (\"test-lib: limit the output of the yes utility\",\n2016-02-02) on Windows?  If I read correctly, the process upstream\nof the pipe (in this case, perl producing a stream of infinite NULs)\nwould not die when the downstream stops reading with SIGPIPE.\n\nOr is it safe to assume that nobody expects to use http-backend on\nWindows based servers so this test is a non-issue?\n\n>>         grep \"fatal:.*CONTENT_LENGTH\" err\n>>  '\n\nThanks.\n"},{"id":"369181","messageId":"f3b506bb-52eb-3a1f-ba3d-0cf327271ab2@kdbg.org","threadId":"50450","inReplyTo":"xmqqd0nwex7w.fsf@gitster-ct.c.googlers.com","subject":"Re: [Patch v1 3/3] t5562: replace /dev/zero with a pipe from generate_zero_bytes","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2019-02-12T20:50:59Z","receivedAt":"2019-02-12T20:51:05Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 12.02.19 um 18:24 schrieb Junio C Hamano:\n>>> diff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh\n>>> @@ -143,14 +143,14 @@ test_expect_success GZIP 'push gzipped empty' '\n>>>  test_expect_success 'CONTENT_LENGTH overflow ssite_t' '\n>>>         NOT_FIT_IN_SSIZE=$(ssize_b100dots) &&\n>>> -       env \\\n>>> +       generate_zero_bytes infinity  | env \\\n>>>                 CONTENT_TYPE=application/x-git-upload-pack-request \\\n>>>                 QUERY_STRING=/repo.git/git-upload-pack \\\n>>>                 PATH_TRANSLATED=\"$PWD\"/.git/git-upload-pack \\\n>>>                 GIT_HTTP_EXPORT_ALL=TRUE \\\n>>>                 REQUEST_METHOD=POST \\\n>>>                 CONTENT_LENGTH=\"$NOT_FIT_IN_SSIZE\" \\\n>>> -               git http-backend </dev/zero >/dev/null 2>err &&\n>>> +               git http-backend >/dev/null 2>err &&\n> \n> Doesn't this \"inifinity\" mode have the same issue that was worked\n> around by 6129c930 (\"test-lib: limit the output of the yes utility\",\n> 2016-02-02) on Windows?  If I read correctly, the process upstream\n> of the pipe (in this case, perl producing a stream of infinite NULs)\n> would not die when the downstream stops reading with SIGPIPE.\n\nI think we do not have to worry, and the reason is that the\njustification for 6129c930 is simply wrong.\n\nAs I did not find the patch series discussed here to pull and test, I\nrepeated the timing tests with t7610-mergetool.sh with and without\n6129c930 reverted, and the difference is only in the noise. The reason\nt7610 takes so long on Windows looks more like a consequence of the\n10,000 processes that it spawns. It is a mystery to me how I came to the\nconclusion that the change in 6129c930 would make a difference. :-(\n\n-- Hannes\n"},{"id":"369239","messageId":"xmqqh8d7d2ij.fsf@gitster-ct.c.googlers.com","threadId":"50450","inReplyTo":"xmqqh8d9diy8.fsf@gitster-ct.c.googlers.com","subject":"Re: [Patch v1 2/3] t5318: replace use of /dev/zero with generate_zero_bytes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-02-13T17:25:24Z","receivedAt":"2019-02-13T17:25:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n>\n>> On Sat, Feb 9, 2019 at 2:00 PM <randall.s.becker@rogers.com> wrote:\n>>> This change removes the dependency on /dev/zero with generate_zero_bytes\n>>> appending NUL values to blocks generating wrong signatures for test cases.\n>>\n>> This commit message says what the patch does but not _why_. At\n>> minimum, it should explain that /dev/zero is not available on all\n>> platforms, therefore, not portable, and (perhaps) cite NonStop as an\n>> example.\n>\n> Does sombody want to do the honors?  [PATCH 1/3] would become wasted\n> effort until that happens.  On the other hand, if this is not urgent\n> (it is only urgent for those without /dev/zero, and to others it may\n> be distraction/disruption this close to the final release to add\n> increased risk of fat finger mistakes), obviously I can wait.\n\nSo, before I lose the access to my primary screen (I was told that\nsomehow I need to reimage the workstation today X-<), here is what I\nhave now.\n\n-- >8 --\nFrom: \"Randall S. Becker\" <rsbecker@nexbridge.com>\nDate: Sat, 9 Feb 2019 13:59:29 -0500\nSubject: [PATCH] t5318: replace use of /dev/zero with generate_zero_bytes\n\nThere are platforms (e.g. NonStop) that lack /dev/zero; use the\ngenerate_zero_bytes helper we just introduced to append stream\nof NULs at the end of the file.\n\nThe original, even though it uses \"dd seek=... count=...\" to make it\nlook like it is overwriting the middle part of an existing file, has\ntruncated the file before this step with another use of \"dd\", which\nmay make it tricky to see why this rewrite is a correct one.\n\nSigned-off-by: Randall S. Becker <rsbecker@nexbridge.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t5318-commit-graph.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh\nindex 16d10ebce8..d4bd1522fe 100755\n--- a/t/t5318-commit-graph.sh\n+++ b/t/t5318-commit-graph.sh\n@@ -383,7 +383,7 @@ corrupt_graph_and_verify() {\n \tcp $objdir/info/commit-graph commit-graph-backup &&\n \tprintf \"$data\" | dd of=\"$objdir/info/commit-graph\" bs=1 seek=\"$pos\" conv=notrunc &&\n \tdd of=\"$objdir/info/commit-graph\" bs=1 seek=\"$zero_pos\" count=0 &&\n-\tdd if=/dev/zero of=\"$objdir/info/commit-graph\" bs=1 seek=\"$zero_pos\" count=$(($orig_size - $zero_pos)) &&\n+\tgenerate_zero_bytes $(($orig_size - $zero_pos)) >>\"$objdir/info/commit-graph\" &&\n \ttest_must_fail git commit-graph verify 2>test_err &&\n \tgrep -v \"^+\" test_err >err &&\n \ttest_i18ngrep \"$grepstr\" err\n-- \n2.21.0-rc0-36-ge9bd4aa026\n\n"},{"id":"369240","messageId":"xmqqd0nvd2h5.fsf@gitster-ct.c.googlers.com","threadId":"50450","inReplyTo":"f3b506bb-52eb-3a1f-ba3d-0cf327271ab2@kdbg.org","subject":"Re: [Patch v1 3/3] t5562: replace /dev/zero with a pipe from generate_zero_bytes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-02-13T17:26:14Z","receivedAt":"2019-02-13T17:26:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> Am 12.02.19 um 18:24 schrieb Junio C Hamano:\n>>>> diff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh\n>>>> @@ -143,14 +143,14 @@ test_expect_success GZIP 'push gzipped empty' '\n>>>>  test_expect_success 'CONTENT_LENGTH overflow ssite_t' '\n>>>>         NOT_FIT_IN_SSIZE=$(ssize_b100dots) &&\n>>>> -       env \\\n>>>> +       generate_zero_bytes infinity  | env \\\n>>>>                 CONTENT_TYPE=application/x-git-upload-pack-request \\\n>>>>                 QUERY_STRING=/repo.git/git-upload-pack \\\n>>>>                 PATH_TRANSLATED=\"$PWD\"/.git/git-upload-pack \\\n>>>>                 GIT_HTTP_EXPORT_ALL=TRUE \\\n>>>>                 REQUEST_METHOD=POST \\\n>>>>                 CONTENT_LENGTH=\"$NOT_FIT_IN_SSIZE\" \\\n>>>> -               git http-backend </dev/zero >/dev/null 2>err &&\n>>>> +               git http-backend >/dev/null 2>err &&\n>> \n>> Doesn't this \"inifinity\" mode have the same issue that was worked\n>> around by 6129c930 (\"test-lib: limit the output of the yes utility\",\n>> 2016-02-02) on Windows?  If I read correctly, the process upstream\n>> of the pipe (in this case, perl producing a stream of infinite NULs)\n>> would not die when the downstream stops reading with SIGPIPE.\n>\n> I think we do not have to worry, and the reason is that the\n> justification for 6129c930 is simply wrong.\n\nThat's kinda surprising but in a pleasant way---it's good that we\nhave one less thing we need to worry about.\n\nThanks.\n\n>\n> As I did not find the patch series discussed here to pull and test, I\n> repeated the timing tests with t7610-mergetool.sh with and without\n> 6129c930 reverted, and the difference is only in the noise. The reason\n> t7610 takes so long on Windows looks more like a consequence of the\n> 10,000 processes that it spawns. It is a mystery to me how I came to the\n> conclusion that the change in 6129c930 would make a difference. :-(\n>\n> -- Hannes\n"},{"id":"369242","messageId":"004701d4c3c8$8a018d20$9e04a760$@nexbridge.com","threadId":"50450","inReplyTo":"xmqqh8d7d2ij.fsf@gitster-ct.c.googlers.com","subject":"RE: [Patch v1 2/3] t5318: replace use of /dev/zero with generate_zero_bytes","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2019-02-13T18:18:31Z","receivedAt":"2019-02-13T18:18:47Z","isPatch":true,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"> -----Original Message-----\n> From: Junio C Hamano <jch2355@gmail.com> On Behalf Of Junio C Hamano\n> Sent: February 13, 2019 12:25\n> To: Eric Sunshine <sunshine@sunshineco.us>\n> Cc: randall.s.becker@rogers.com; Git List <git@vger.kernel.org>; Randall\nS.\n> Becker <rsbecker@nexbridge.com>\n> Subject: Re: [Patch v1 2/3] t5318: replace use of /dev/zero with\n> generate_zero_bytes\n> \n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Eric Sunshine <sunshine@sunshineco.com> writes:\n> >\n> >> On Sat, Feb 9, 2019 at 2:00 PM <randall.s.becker@rogers.com> wrote:\n> >>> This change removes the dependency on /dev/zero with\n> >>> generate_zero_bytes appending NUL values to blocks generating wrong\n> signatures for test cases.\n> >>\n> >> This commit message says what the patch does but not _why_. At\n> >> minimum, it should explain that /dev/zero is not available on all\n> >> platforms, therefore, not portable, and (perhaps) cite NonStop as an\n> >> example.\n> >\n> > Does sombody want to do the honors?  [PATCH 1/3] would become wasted\n> > effort until that happens.  On the other hand, if this is not urgent\n> > (it is only urgent for those without /dev/zero, and to others it may\n> > be distraction/disruption this close to the final release to add\n> > increased risk of fat finger mistakes), obviously I can wait.\n> \n> So, before I lose the access to my primary screen (I was told that somehow\nI\n> need to reimage the workstation today X-<), here is what I have now.\n> \n> -- >8 --\n> From: \"Randall S. Becker\" <rsbecker@nexbridge.com>\n> Date: Sat, 9 Feb 2019 13:59:29 -0500\n> Subject: [PATCH] t5318: replace use of /dev/zero with generate_zero_bytes\n> \n> There are platforms (e.g. NonStop) that lack /dev/zero; use the\n> generate_zero_bytes helper we just introduced to append stream of NULs at\n> the end of the file.\n> \n> The original, even though it uses \"dd seek=... count=...\" to make it look\nlike it\n> is overwriting the middle part of an existing file, has truncated the file\nbefore\n> this step with another use of \"dd\", which may make it tricky to see why\nthis\n> rewrite is a correct one.\n\nHere is how I interpret the test - might be wrong, but yanno...\nThe first dd copies something looking like reasonable data from the test\ncase.\nThe second dd copies zeros from seek to the end of a fixed size block.\n\nMy first attempt at a fix used truncate that extended the first to the\ncorrect size (filling with zeros). My worry there is that I'm not sure there\nis a guarantee of zeros, but that shouldn't matter for the test which just\nwants a signature mismatch.\n\nOthers suggested using yes to fill in junk.\n\nMy second attempt was to create the generate_zero_bytes function to replace\nexactly what the second dd was doing but not user /dev/zero. The fix was not\nto change the conditions of the test - not debating the correctness of that\nhere - but to simply replicate the use of /dev/zero in context. So the\nresulting file contains [reasonable-stuff]{seek}[0]{orig_size-seek}, which\nis sufficient to satisfy the conditions of the test.\n\n> \n> Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>\n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  t/t5318-commit-graph.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh index\n> 16d10ebce8..d4bd1522fe 100755\n> --- a/t/t5318-commit-graph.sh\n> +++ b/t/t5318-commit-graph.sh\n> @@ -383,7 +383,7 @@ corrupt_graph_and_verify() {\n>  \tcp $objdir/info/commit-graph commit-graph-backup &&\n>  \tprintf \"$data\" | dd of=\"$objdir/info/commit-graph\" bs=1\n> seek=\"$pos\" conv=notrunc &&\n>  \tdd of=\"$objdir/info/commit-graph\" bs=1 seek=\"$zero_pos\" count=0\n> &&\n> -\tdd if=/dev/zero of=\"$objdir/info/commit-graph\" bs=1\n> seek=\"$zero_pos\" count=$(($orig_size - $zero_pos)) &&\n> +\tgenerate_zero_bytes $(($orig_size - $zero_pos))\n> +>>\"$objdir/info/commit-graph\" &&\n>  \ttest_must_fail git commit-graph verify 2>test_err &&\n>  \tgrep -v \"^+\" test_err >err &&\n>  \ttest_i18ngrep \"$grepstr\" err\n\n"},{"id":"369253","messageId":"xmqqr2cbbdz6.fsf@gitster-ct.c.googlers.com","threadId":"50450","inReplyTo":"004701d4c3c8$8a018d20$9e04a760$@nexbridge.com","subject":"Re: [Patch v1 2/3] t5318: replace use of /dev/zero with generate_zero_bytes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-02-13T21:00:45Z","receivedAt":"2019-02-13T21:00:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Randall S. Becker\" <rsbecker@nexbridge.com> writes:\n\n> My second attempt was to create the generate_zero_bytes function to replace\n> exactly what the second dd was doing but not user /dev/zero.\n\nYes, and I think the patch does that ;-)  It was just the original\n\n    dd if=/dev/zero of=... bs=1 seek=$there count=$this_many\n\nwould have been impossible to rewrite with the new generate_zero_bytes\nhelper unless $there weren't seeking to the end of the file.\n\nBut the other dd before the one the patch rewrites truncates the\nfile to make that seek=$there seeking to the end of the file, so\nsimply appending output from genereate_zero_bytes is sufficient and\ncorrect conversion.  I wanted to explain that for future readers who\nmay wonder if the patch is doing the exact conversion.\n\n"},{"id":"369254","messageId":"009101d4c3df$9616d8b0$c2448a10$@nexbridge.com","threadId":"50450","inReplyTo":"xmqqr2cbbdz6.fsf@gitster-ct.c.googlers.com","subject":"RE: [Patch v1 2/3] t5318: replace use of /dev/zero with generate_zero_bytes","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2019-02-13T21:03:30Z","receivedAt":"2019-02-13T21:03:42Z","isPatch":true,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On February 13, 2019 16:01, Junio C Hamano wrote:\n> \"Randall S. Becker\" <rsbecker@nexbridge.com> writes:\n> \n> > My second attempt was to create the generate_zero_bytes function to\n> > replace exactly what the second dd was doing but not user /dev/zero.\n> \n> Yes, and I think the patch does that ;-)  It was just the original\n> \n>     dd if=/dev/zero of=... bs=1 seek=$there count=$this_many\n> \n> would have been impossible to rewrite with the new generate_zero_bytes\n> helper unless $there weren't seeking to the end of the file.\n> \n> But the other dd before the one the patch rewrites truncates the file to\nmake\n> that seek=$there seeking to the end of the file, so simply appending\noutput\n> from genereate_zero_bytes is sufficient and correct conversion.  I wanted\nto\n> explain that for future readers who may wonder if the patch is doing the\n> exact conversion.\n\nSounds like we need a documentation patch in the actual test suite rather\nthan in the commit <ducking>.\n\nCheers,\nRandall\n\n\n"},{"id":"369392","messageId":"20190215164237.12250-1-max@max630.net","threadId":"50450","inReplyTo":"20190209185930.5256-4-randall.s.becker@rogers.com","subject":"[PATCH] t5562: do not depend on /dev/zero","fromName":"Max Kirillov","fromEmail":"max@max630.net","sentAt":"2019-02-15T16:42:37Z","receivedAt":"2019-02-15T16:42:47Z","isPatch":true,"sender":{"key":"max@max630.net","avatar":"https://avatars.githubusercontent.com/u/381560?v=4"},"body":"It was reported [1] that NonStop platform does not have /dev/zero.\n\nThe test uses /dev/zero as a dummy input. Passing case (http-backed\nfailed because of too big input size) should not be reading anything\nfrom it. If http-backend would erroneously try to read any data\nreturning EOF probably would be even safer than providing some\nmeaningless data.\n\nReplace /dev/zero with /dev/null to avoid issues with platforms which do\nnot have /dev/zero.\n\n[1] https://public-inbox.org/git/20190209185930.5256-4-randall.s.becker@rogers.com/\n\nReported-by: Randall S. Becker <rsbecker@nexbridge.com>\nSigned-off-by: Max Kirillov <max@max630.net>\n---\nBy the way, I don't think this requires such sofisticated\nfix. In the success case the input would not be read at all.\nYou could replace it with /dev/null, the in failure (not \nimmediate fail) git would fail due to truncated input or\nsomething.\n\nAlso, as you experience hang issue [2] in earlier tests, this \none should not have contributed to it.\n\n[2] https://public-inbox.org/git/001901d4c22b$194bfe60$4be3fb20$@nexbridge.com/\n t/t5562-http-backend-content-length.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5562-http-backend-content-length.sh b/t/t5562-http-backend-content-length.sh\nindex 90d890d02f..436c261c86 100755\n--- a/t/t5562-http-backend-content-length.sh\n+++ b/t/t5562-http-backend-content-length.sh\n@@ -150,7 +150,7 @@ test_expect_success 'CONTENT_LENGTH overflow ssite_t' '\n \t\tGIT_HTTP_EXPORT_ALL=TRUE \\\n \t\tREQUEST_METHOD=POST \\\n \t\tCONTENT_LENGTH=\"$NOT_FIT_IN_SSIZE\" \\\n-\t\tgit http-backend </dev/zero >/dev/null 2>err &&\n+\t\tgit http-backend </dev/null >/dev/null 2>err &&\n \tgrep \"fatal:.*CONTENT_LENGTH\" err\n '\n \n-- \n2.19.0.1202.g68e1e8f04e\n\n"},{"id":"369394","messageId":"001601d4c551$d0f24c30$72d6e490$@nexbridge.com","threadId":"50450","inReplyTo":"20190215164237.12250-1-max@max630.net","subject":"RE: [PATCH] t5562: do not depend on /dev/zero","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2019-02-15T17:13:42Z","receivedAt":"2019-02-15T17:13:57Z","isPatch":true,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On February 15, 2019 11:43, Max Kirillov wrote:\n> It was reported [1] that NonStop platform does not have /dev/zero.\n> \n> The test uses /dev/zero as a dummy input. Passing case (http-backed failed\n> because of too big input size) should not be reading anything from it. If\nhttp-\n> backend would erroneously try to read any data returning EOF probably\n> would be even safer than providing some meaningless data.\n> \n> Replace /dev/zero with /dev/null to avoid issues with platforms which do\nnot\n> have /dev/zero.\n> \n> [1] https://public-inbox.org/git/20190209185930.5256-4-\n> randall.s.becker@rogers.com/\n> \n> Reported-by: Randall S. Becker <rsbecker@nexbridge.com>\n> Signed-off-by: Max Kirillov <max@max630.net>\n> ---\n> By the way, I don't think this requires such sofisticated fix. In the\nsuccess\n> case the input would not be read at all.\n> You could replace it with /dev/null, the in failure (not immediate fail)\ngit\n> would fail due to truncated input or something.\n> \n> Also, as you experience hang issue [2] in earlier tests, this one should\nnot\n> have contributed to it.\n> \n> [2] https://public-\n> inbox.org/git/001901d4c22b$194bfe60$4be3fb20$@nexbridge.com/\n>  t/t5562-http-backend-content-length.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/t/t5562-http-backend-content-length.sh\nb/t/t5562-http-backend-\n> content-length.sh\n> index 90d890d02f..436c261c86 100755\n> --- a/t/t5562-http-backend-content-length.sh\n> +++ b/t/t5562-http-backend-content-length.sh\n> @@ -150,7 +150,7 @@ test_expect_success 'CONTENT_LENGTH overflow\n> ssite_t' '\n>  \t\tGIT_HTTP_EXPORT_ALL=TRUE \\\n>  \t\tREQUEST_METHOD=POST \\\n>  \t\tCONTENT_LENGTH=\"$NOT_FIT_IN_SSIZE\" \\\n> -\t\tgit http-backend </dev/zero >/dev/null 2>err &&\n> +\t\tgit http-backend </dev/null >/dev/null 2>err &&\n>  \tgrep \"fatal:.*CONTENT_LENGTH\" err\n\nFTR, this particular subtest is not the one that is hanging. This subtest\npasses on NonStop with any and all (now) 4 solutions that have been floating\naround.\n\nCheers,\nRandall\n\n"},{"id":"369402","messageId":"xmqqsgwp53uj.fsf@gitster-ct.c.googlers.com","threadId":"50450","inReplyTo":"001601d4c551$d0f24c30$72d6e490$@nexbridge.com","subject":"Re: [PATCH] t5562: do not depend on /dev/zero","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-02-15T18:00:36Z","receivedAt":"2019-02-15T18:07:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Randall S. Becker\" <rsbecker@nexbridge.com> writes:\n\n> FTR, this particular subtest is not the one that is hanging. This subtest\n> passes on NonStop with any and all (now) 4 solutions that have been floating\n> around.\n\nOne thing I'd like to know more is if this test passes on NonStop\nwith this patch, i.e. /dev/zero replaced with /dev/null.\n\nThanks.\n"},{"id":"369403","messageId":"001d01d4c559$b4f62b20$1ee28160$@nexbridge.com","threadId":"50450","inReplyTo":"xmqqsgwp53uj.fsf@gitster-ct.c.googlers.com","subject":"RE: [PATCH] t5562: do not depend on /dev/zero","fromName":"Randall S. Becker","fromEmail":"rsbecker@nexbridge.com","sentAt":"2019-02-15T18:10:12Z","receivedAt":"2019-02-15T18:10:26Z","isPatch":true,"sender":{"key":"randall.becker@nexbridge.ca","avatar":"https://avatars.githubusercontent.com/u/28956764?v=4"},"body":"On February 15, 2019 13:01, Junio C Hamano wrote:\n> To: Randall S. Becker <rsbecker@nexbridge.com>\n> Cc: 'Max Kirillov' <max@max630.net>; git@vger.kernel.org; 'Johannes\n> Schindelin' <Johannes.Schindelin@gmx.de>\n> Subject: Re: [PATCH] t5562: do not depend on /dev/zero\n> \n> \"Randall S. Becker\" <rsbecker@nexbridge.com> writes:\n> \n> > FTR, this particular subtest is not the one that is hanging. This\n> > subtest passes on NonStop with any and all (now) 4 solutions that have\n> > been floating around.\n> \n> One thing I'd like to know more is if this test passes on NonStop with\nthis\n> patch, i.e. /dev/zero replaced with /dev/null.\n\nYes, this particular subtest passes replacing /dev/null. The other three\nsubtests still hang. This subtest never did.\n\n"},{"id":"369408","messageId":"xmqqd0ns6gbm.fsf@gitster-ct.c.googlers.com","threadId":"50450","inReplyTo":"001d01d4c559$b4f62b20$1ee28160$@nexbridge.com","subject":"Re: [PATCH] t5562: do not depend on /dev/zero","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-02-15T18:45:49Z","receivedAt":"2019-02-15T18:45:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Randall S. Becker\" <rsbecker@nexbridge.com> writes:\n\n> On February 15, 2019 13:01, Junio C Hamano wrote:\n>> To: Randall S. Becker <rsbecker@nexbridge.com>\n>> Cc: 'Max Kirillov' <max@max630.net>; git@vger.kernel.org; 'Johannes\n>> Schindelin' <Johannes.Schindelin@gmx.de>\n>> Subject: Re: [PATCH] t5562: do not depend on /dev/zero\n>> \n>> \"Randall S. Becker\" <rsbecker@nexbridge.com> writes:\n>> \n>> > FTR, this particular subtest is not the one that is hanging. This\n>> > subtest passes on NonStop with any and all (now) 4 solutions that have\n>> > been floating around.\n>> \n>> One thing I'd like to know more is if this test passes on NonStop with\n> this\n>> patch, i.e. /dev/zero replaced with /dev/null.\n>\n> Yes, this particular subtest passes replacing /dev/null. The other three\n> subtests still hang. This subtest never did.\n\nThanks.\n"}]}