t4216-log-bloom.sh broken ?

Torsten Bögershausen
2024-05-02T05:56:28Z

[]

Highjacking the Git v2.45.0 announcement:
There are 4 test cases in t4216-log-bloom.sh, that do not pass on one
Mac here (they pass on another machine)

I haven't digged further, but here are some log files,
hopefully helpful to somebody.

not ok 141 - Bloom reader notices too-small data chunk
#
# check_corrupt_graph BDAT clear 00000000 &&
# echo "warning: ignoring too-small changed-path chunk" \
# "(4 < 12) in commit-graph file" >expect.err &&
# test_cmp expect.err err
#
not ok 142 - Bloom reader notices out-of-bounds filter offsets
#
# check_corrupt_graph BIDX 12 FFFFFFFF &&
# # use grep to avoid depending on exact chunk size
# grep "warning: ignoring out-of-range offset (4294967295) for changed-path filter at pos 3 of .git/objects/info/commit-graph" err

#
not ok 143 - Bloom reader notices too-small index chunk
#
# # replace the index with a single entry, making most
# # lookups out-of-bounds
# check_corrupt_graph BIDX clear 00000000 &&
# echo "warning: commit-graph changed-path index chunk" \
# "is too small" >expect.err &&
# test_cmp expect.err err
#
not ok 144 - Bloom reader notices out-of-order index offsets
#
# # we do not know any real offsets, but we can pick
# # something plausible; we should not get to the point of
# # actually reading from the bogus offsets anyway.
# corrupt_graph BIDX 4 0000000c00000005 &&
# echo "warning: ignoring decreasing changed-path index offsets" \
# "(12 > 5) for positions 1 and 2 of .git/objects/info/commit-graph" >expect.err &&
# git -c core.commitGraph=false log -- A/B/file2 >expect.out &&
# git -c core.commitGraph=true log -- A/B/file2 >out 2>err &&
# test_cmp expect.out out &&
# test_cmp expect.err err
#
# failed 4 among 144 test(s)
1..144

ok 140 - Bloom generation backfills empty commits

expecting success of 4216.141 'Bloom reader notices too-small data chunk':
check_corrupt_graph BDAT clear 00000000 &&
echo "warning: ignoring too-small changed-path chunk" \
"(4 < 12) in commit-graph file" >expect.err &&
test_cmp expect.err err

++ check_corrupt_graph BDAT clear 00000000
++ corrupt_graph BDAT clear 00000000
++ graph=.git/objects/info/commit-graph
++ test_when_finished 'rm -rf .git/objects/info/commit-graph'
++ test 0 = 0
++ test_cleanup='{ rm -rf .git/objects/info/commit-graph
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git commit-graph write --reachable --changed-paths
++ corrupt_chunk_file .git/objects/info/commit-graph BDAT clear 00000000
++ fn=.git/objects/info/commit-graph
++ shift
++ perl /Users/tb/NoBackup/projects/git/git.pu/t/lib-chunk/corrupt-chunk-file.pl BDAT clear 00000000
++ command /usr/bin/perl /Users/tb/NoBackup/projects/git/git.pu/t/lib-chunk/corrupt-chunk-file.pl BDAT clear 00000000
++ /usr/bin/perl /Users/tb/NoBackup/projects/git/git.pu/t/lib-chunk/corrupt-chunk-file.pl BDAT clear 00000000
++ mv .git/objects/info/commit-graph.tmp .git/objects/info/commit-graph
override r--r--r-- tb/staff for .git/objects/info/commit-graph? (y/n [n]) not overwritten
++ git -c core.commitGraph=false log -- A/B/file2
++ git -c core.commitGraph=true log -- A/B/file2
++ test_cmp expect.out out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.out out
++ echo 'warning: ignoring too-small changed-path chunk' '(4 < 12) in commit-graph file'
++ test_cmp expect.err err
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.err err
--- expect.err 2024-05-02 05:51:10.000000000 +0000
+++ err 2024-05-02 05:51:10.000000000 +0000
@@ -1 +0,0 @@
-warning: ignoring too-small changed-path chunk (4 < 12) in commit-graph file
error: last command exited with $?=1
++ rm -rf .git/objects/info/commit-graph
++ exit 1
++ eval_ret=1
++ :
not ok 141 - Bloom reader notices too-small data chunk

expecting success of 4216.142 'Bloom reader notices out-of-bounds filter offsets':
check_corrupt_graph BIDX 12 FFFFFFFF &&
# use grep to avoid depending on exact chunk size
grep "warning: ignoring out-of-range offset (4294967295) for changed-path filter at pos 3 of .git/objects/info/commit-graph" err

++ check_corrupt_graph BIDX 12 FFFFFFFF
++ corrupt_graph BIDX 12 FFFFFFFF
++ graph=.git/objects/info/commit-graph
++ test_when_finished 'rm -rf .git/objects/info/commit-graph'
++ test 0 = 0
++ test_cleanup='{ rm -rf .git/objects/info/commit-graph
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git commit-graph write --reachable --changed-paths
++ corrupt_chunk_file .git/objects/info/commit-graph BIDX 12 FFFFFFFF
++ fn=.git/objects/info/commit-graph
++ shift
++ perl /Users/tb/NoBackup/projects/git/git.pu/t/lib-chunk/corrupt-chunk-file.pl BIDX 12 FFFFFFFF
++ command /usr/bin/perl /Users/tb/NoBackup/projects/git/git.pu/t/lib-chunk/corrupt-chunk-file.pl BIDX 12 FFFFFFFF
++ /usr/bin/perl /Users/tb/NoBackup/projects/git/git.pu/t/lib-chunk/corrupt-chunk-file.pl BIDX 12 FFFFFFFF
++ mv .git/objects/info/commit-graph.tmp .git/objects/info/commit-graph
override r--r--r-- tb/staff for .git/objects/info/commit-graph? (y/n [n]) not overwritten
++ git -c core.commitGraph=false log -- A/B/file2
++ git -c core.commitGraph=true log -- A/B/file2
++ test_cmp expect.out out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.out out
++ grep 'warning: ignoring out-of-range offset (4294967295) for changed-path filter at pos 3 of .git/objects/info/commit-graph' err
error: last command exited with $?=1
++ rm -rf .git/objects/info/commit-graph
++ exit 1
++ eval_ret=1
++ :
not ok 142 - Bloom reader notices out-of-bounds filter offsets

expecting success of 4216.143 'Bloom reader notices too-small index chunk':
# replace the index with a single entry, making most
# lookups out-of-bounds
check_corrupt_graph BIDX clear 00000000 &&
echo "warning: commit-graph changed-path index chunk" \
"is too small" >expect.err &&
test_cmp expect.err err

++ check_corrupt_graph BIDX clear 00000000
++ corrupt_graph BIDX clear 00000000
++ graph=.git/objects/info/commit-graph
++ test_when_finished 'rm -rf .git/objects/info/commit-graph'
++ test 0 = 0
++ test_cleanup='{ rm -rf .git/objects/info/commit-graph
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git commit-graph write --reachable --changed-paths
++ corrupt_chunk_file .git/objects/info/commit-graph BIDX clear 00000000
++ fn=.git/objects/info/commit-graph
++ shift
++ perl /Users/tb/NoBackup/projects/git/git.pu/t/lib-chunk/corrupt-chunk-file.pl BIDX clear 00000000
++ command /usr/bin/perl /Users/tb/NoBackup/projects/git/git.pu/t/lib-chunk/corrupt-chunk-file.pl BIDX clear 00000000
++ /usr/bin/perl /Users/tb/NoBackup/projects/git/git.pu/t/lib-chunk/corrupt-chunk-file.pl BIDX clear 00000000
++ mv .git/objects/info/commit-graph.tmp .git/objects/info/commit-graph
override r--r--r-- tb/staff for .git/objects/info/commit-graph? (y/n [n]) not overwritten
++ git -c core.commitGraph=false log -- A/B/file2
++ git -c core.commitGraph=true log -- A/B/file2
++ test_cmp expect.out out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.out out
++ echo 'warning: commit-graph changed-path index chunk' 'is too small'
++ test_cmp expect.err err
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.err err
--- expect.err 2024-05-02 05:51:11.000000000 +0000
+++ err 2024-05-02 05:51:11.000000000 +0000
@@ -1 +0,0 @@
-warning: commit-graph changed-path index chunk is too small
error: last command exited with $?=1
++ rm -rf .git/objects/info/commit-graph
++ exit 1
++ eval_ret=1
++ :
not ok 143 - Bloom reader notices too-small index chunk

expecting success of 4216.144 'Bloom reader notices out-of-order index offsets':
# we do not know any real offsets, but we can pick
# something plausible; we should not get to the point of
# actually reading from the bogus offsets anyway.
corrupt_graph BIDX 4 0000000c00000005 &&
echo "warning: ignoring decreasing changed-path index offsets" \
"(12 > 5) for positions 1 and 2 of .git/objects/info/commit-graph" >expect.err &&
git -c core.commitGraph=false log -- A/B/file2 >expect.out &&
git -c core.commitGraph=true log -- A/B/file2 >out 2>err &&
test_cmp expect.out out &&
test_cmp expect.err err

++ corrupt_graph BIDX 4 0000000c00000005
++ graph=.git/objects/info/commit-graph
++ test_when_finished 'rm -rf .git/objects/info/commit-graph'
++ test 0 = 0
++ test_cleanup='{ rm -rf .git/objects/info/commit-graph
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git commit-graph write --reachable --changed-paths
++ corrupt_chunk_file .git/objects/info/commit-graph BIDX 4 0000000c00000005
++ fn=.git/objects/info/commit-graph
++ shift
++ perl /Users/tb/NoBackup/projects/git/git.pu/t/lib-chunk/corrupt-chunk-file.pl BIDX 4 0000000c00000005
++ command /usr/bin/perl /Users/tb/NoBackup/projects/git/git.pu/t/lib-chunk/corrupt-chunk-file.pl BIDX 4 0000000c00000005
++ /usr/bin/perl /Users/tb/NoBackup/projects/git/git.pu/t/lib-chunk/corrupt-chunk-file.pl BIDX 4 0000000c00000005
++ mv .git/objects/info/commit-graph.tmp .git/objects/info/commit-graph
override r--r--r-- tb/staff for .git/objects/info/commit-graph? (y/n [n]) not overwritten
++ echo 'warning: ignoring decreasing changed-path index offsets' '(12 > 5) for positions 1 and 2 of .git/objects/info/commit-graph'
++ git -c core.commitGraph=false log -- A/B/file2
++ git -c core.commitGraph=true log -- A/B/file2
++ test_cmp expect.out out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.out out
++ test_cmp expect.err err
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.err err
--- expect.err 2024-05-02 05:51:11.000000000 +0000
+++ err 2024-05-02 05:51:11.000000000 +0000
@@ -1 +0,0 @@
-warning: ignoring decreasing changed-path index offsets (12 > 5) for positions 1 and 2 of .git/objects/info/commit-graph
error: last command exited with $?=1
++ rm -rf .git/objects/info/commit-graph
++ exit 1
++ eval_ret=1
++ :
not ok 144 - Bloom reader notices out-of-order index offsets