Re: [PATCH v2 3/3] pack-bitmap: add loading corrupt bitmap_index test
- From
lidongyan <502024330056@smail.nju.edu.cn>
- Date
- May 23, 2025, 07:17 UTC
- Message-ID
- <CD2E6414-76C3-4A0B-A625-C3146BEF2686@smail.nju.edu.cn>
- In-Reply-To
- <aC/B21ZYCixgFSfe@nand.local>
2025年5月23日 08:31,Taylor Blau <me@ttaylorr.com> 写道:
Show 13 quoted lines
> But the (elided) code below isn't quite what I was thinking. I think the > "write garbage data" part is fine as-is and can continue to be written > in shell. We have lots of examples of using dd to write garbage data > into files (see for e.g., the "corrupt_data()" function in t5319). > > What I was thinking is the test helper would print (via some new mode, > or bolted onto "list-commits") line-delimited output like the following: > > $COMMIT_OID $BITMAP_OFFSET $FLAGS $XOR_OFFSET > > or similar. Then you could use the output of that to determine the > location (replacing everything up to the actual "printf | dd > of=$bitmap ...", which is the most fragile in my opinion).
Agreed, I would add a `test-tool bitmap dump-entries` helper which dumps the output you suggest.
> I think the above scenario (writing a test that would have leaked memory > otherwise behind a SANITIZE_LEAK prerequisite) is reasonable.
I will submit patch v3 with better structure and cover letter soon.
Thanks, Lidong