You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
t5333: test memory leak when use pseudo-merge in boundary traversal
In pack-bitmap.c:find_boundary_objects(), the roots_bitmap is only freed
if cascade_pseudo_merges_1() fails. Otherwise, it leaks, leading to
a memory leak that currently lacks a dedicated test to detect it.
To trigger this leak, we need a pseudo-merge whose size is equal to
or smaller than roots_bitmap (which corresponds to the set of "haves"
commits in prepare_bitmap_walk()). To do this, we can create two
commits: A and B. Add A to the pseudo-merge list and perform a traversal
over the range A..B. In this scenario, the "haves" set will be {A},
and cascade_pseudo_merges_1() will succeed — thereby exposing the leak
due to the missing roots_bitmap cleanup.
Signed-off-by: Lidong Yan <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
0 commit comments