On Wed, Nov 06, 2024 at 04:10:14PM +0100, Patrick Steinhardt wrote: > Hi, > > this is the last part of my series of memory leak fixes. This series > goes a bit further than past series: > > - Patches 1 to 16 plug remaining memory leaks exposed by our test > suite. > > - Patches 17 to 21 remove the last remaining `UNLEAK()` annotations > and ultimately remove the macro itself. > > - Patch 22 works around a bug in the leak sanitizer itself. > > - Patches 23 and 24 drop annotations where leak-free tests pass with > the leak sanitizer. > > - Patches 25 and 26 unconditionally enable leak checking in all newly > added tests and then drop the `TEST_PASSES_SANITIZE_LEAK` > annotation. Hi Patrick. Thanks for working on this. It's been a while since 956d2e4639 (tests: add a test mode for SANITIZE=leak, run it in CI, 2021-09-23). This series marks certainly another milestone. I have left a few comments, none of them important. The series looks good to me. Just in case you re-roll, while reading the series I spotted some nits: diff --git a/bisect.c b/bisect.c index 518be70aa3..0e804086cb 100644 --- a/bisect.c +++ b/bisect.c @@ -641,7 +641,7 @@ static struct commit_list *skip_away(struct commit_list *list, int count) else if (previous) result = previous; else - result = list; + result = list; break; } previous = cur; diff --git a/builtin/init-db.c b/builtin/init-db.c index 9e069e2742..096f96b9c4 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -248,9 +248,9 @@ int cmd_init_db(int argc, } flags |= INIT_DB_EXIST_OK; - ret = init_db(git_dir, real_git_dir, template_dir, hash_algo, - ref_storage_format, initial_branch, - init_shared_repository, flags); + ret = init_db(git_dir, real_git_dir, template_dir, hash_algo, + ref_storage_format, initial_branch, + init_shared_repository, flags); free(template_dir_to_free); free(real_git_dir_to_free); > > So once this series lands, the expectation is that any newly added test > needs to be leak free by default. We still have an escape hatch in the > form of the SANITIZE_LEAK prerequisite, but patch authors are expected > to provide good arguments why their test cannot be made leak free. > > This series is built on top of 8f8d6eee53 (The seventh batch, > 2024-11-01) with ps/leakfixes-part-9 at c810549be1 > (list-objects-filter-options: work around reported leak on error, > 2024-11-05) merged into it. > > The series has some trivial conflicts with the removed test annotations > when merging with `seen`. There are two topics in-flight that introduce > new memory leaks (ds/path-walk and cc/promisor-remote-capability), both > of which are fixed by the below patch. I've sent a message in response > to the individual commits that introduce the leaks. > > Thanks! > > Patrick