From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
Eric Sunshine <sunshine@sunshineco.com>
Subject: [PATCH v2 2/2] t9300: work around partial read bug in Dash v0.5.13
Date: Thu, 02 Apr 2026 08:51:19 +0200 [thread overview]
Message-ID: <20260402-pks-tests-with-dash-v2-2-cd7ab11dabc0@pks.im> (raw)
In-Reply-To: <20260402-pks-tests-with-dash-v2-0-cd7ab11dabc0@pks.im>
When executing t9300 with Dash v0.5.13.1 we can see that the test hangs
completely with the following (condensed) trace:
git fast-import
+ error=1
+ read output
+ cat input
+ echo checkpoint
+ echo progress checkpoint
+ test rogress checkpoint = progress checkpoint
+ test rogress checkpoint = UNEXPECTED
+ echo cruft: rogress checkpoint
cruft: rogress checkpoint
+ read output
+ test = progress checkpoint
+ test = UNEXPECTED
+ echo cruft:
cruft:
+ read output
Basically, what's happening here is that we spawn git-fast-import(1) and
wait for it to output a certain string, "progress checkpoint". Curiously
though, what we end up reading is "rogress checkpoint" -- so the first
byte of the expected string is missing.
Same as in the preceding commit, this seems to be a bug in Dash itself
that bisects to c5bf970 (expand: Add multi-byte support to pmatch,
2024-06-02). But other than in the preceding commit, this bug has
already been fixed upstream in 079059a (input: Fix heap-buffer-overflow
in preadbuffer on long lines, 2026-02-11), which is part of v0.5.13.2.
For now though, work around the bug by waiting for the expected output
in a different way. There is no good reason why one version should work
better than the other, but at least the new version doesn't exhibit the
bug. And, if you ask me, it's also slightly easier to read.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
t/t9300-fast-import.sh | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 5685cce6fe..479437760b 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -3635,25 +3635,21 @@ background_import_then_checkpoint () {
echo "progress checkpoint"
) >&8 &
- error=1 ;# assume the worst
- while read output <&9
- do
- if test "$output" = "progress checkpoint"
- then
- error=0
- break
- elif test "$output" = "UNEXPECTED"
- then
- break
- fi
- # otherwise ignore cruft
- echo >&2 "cruft: $output"
- done
+ last=$(
+ while read output <&9
+ do
+ if test "$output" = "progress checkpoint" || test "$output" = "UNEXPECTED"
+ then
+ echo "$output"
+ break
+ else
+ # otherwise ignore cruft
+ echo >&2 "cruft: $output"
+ fi
+ done
+ )
- if test $error -eq 1
- then
- false
- fi
+ test "$last" = "progress checkpoint"
}
background_import_still_running () {
--
2.53.0.1323.g189a785ab5.dirty
prev parent reply other threads:[~2026-04-02 6:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 10:42 [PATCH 0/2] t: work around bugs in Dash v0.5.13 Patrick Steinhardt
2026-04-01 10:42 ` [PATCH 1/2] t: work around multibyte bug in quoted heredocs with " Patrick Steinhardt
2026-04-01 16:21 ` Eric Sunshine
2026-04-02 5:44 ` Patrick Steinhardt
2026-04-01 10:42 ` [PATCH 2/2] t9300: work around partial read bug in " Patrick Steinhardt
2026-04-02 6:51 ` [PATCH v2 0/2] t: work around bugs " Patrick Steinhardt
2026-04-02 6:51 ` [PATCH v2 1/2] t: work around multibyte bug in quoted heredocs with " Patrick Steinhardt
2026-05-07 5:57 ` [PATCH] parser: Fix multi-byte output in here-doc with quoted delimiter Herbert Xu
2026-05-07 7:37 ` Herbert Xu
2026-04-02 6:51 ` Patrick Steinhardt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260402-pks-tests-with-dash-v2-2-cd7ab11dabc0@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox