git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] pack-bitmap: remove checks before bitmap_free

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 4, 2025, 12:32 UTC
Message-ID
<xmqqcybjg00s.fsf@gitster.g>
In-Reply-To
<B7032488-F47A-46B9-AF9C-D059AFC31FE8@smail.nju.edu.cn>
lidongyan <502024330056@smail.nju.edu.cn> writes:
Show 11 quoted lines
> No, this test case should only fail when ’SANITIZE_LEAK’ is set. I heard
> that other developer call this type of test as prereq. So only when git is
> compiled with `-fsanitize=address` and `export ASAN_OPTION=detect_leaks=1`
> and without changes as
>
> - if (!cascade_pseudo_merges_1(bitmap_git, cb.base, roots_bitmap))
> - bitmap_free(roots_bitmap);
> + cascade_pseudo_merges_1(bitmap_git, cb.base, roots_bitmap);
> + bitmap_free(roots_bitmap);
>
> This test case would fail.

If the test tickles the code path that used to be broken (and corrected by the patch), temporarily reverting only the code changes to pack-bitmap.c and then this test (under leak sanitizer, of course) should have failed. And if the test passed with such an experiment, you would have noticed that something is wrong.

But you didn't notice it and sent the patch, so I'd assume that you saw such a test still failed. IOW, with "export" forgotten in the test, the original (unfixed) code still leaked, without using the bitmap traversal, right?

Which was where my question came from.

Or perhaps you didn't do that "is my test really tickling the bug I fixed and makes the original code without my fix fail?" test? Which also explains why lack of "export" was not noticed.

Previous: lidongyanNext: lidongyan
Message 16 of 28 in “pack-bitmap: remove checks before bitmap_free”
  1. pack-bitmap: remove checks before bitmap_freeLidong Yan via GitGitGadget, May 25, 2025
  2. Patrick SteinhardtMay 26, 2025
  3. lidongyanMay 26, 2025
  4. 0/2 pack-bitmap: remove checks before bitmap_freeLidong Yan via GitGitGadget, May 30, 2025
  5. 2/2 t5333: test memory leak when use pseudo-merge in boundary traversalLidong Yan via GitGitGadget, May 30, 2025
  6. Junio C HamanoMay 30, 2025
  7. Eric SunshineMay 30, 2025
  8. lidongyanMay 31, 2025
  9. 1/2 pack-bitmap: remove checks before bitmap_freeLidong Yan via GitGitGadget, May 30, 2025
  10. Junio C HamanoMay 30, 2025
  11. pack-bitmap: remove checks before bitmap_freeLidong Yan via GitGitGadget, Jun 3, 2025
  12. Junio C HamanoJun 3, 2025
  13. lidongyanJun 3, 2025
  14. Junio C HamanoJun 3, 2025
  15. lidongyanJun 3, 2025
  16. Junio C HamanoJun 4, 2025
  17. lidongyanJun 4, 2025
  18. Junio C HamanoJun 4, 2025
  19. pack-bitmap: remove checks before bitmap_freeLidong Yan via GitGitGadget, Jun 3, 2025
  20. Taylor BlauJun 3, 2025
  21. lidongyanJun 4, 2025
  22. pack-bitmap: remove checks before bitmap_freeLidong Yan via GitGitGadget, Jun 5, 2025
  23. Junio C HamanoJun 5, 2025
  24. lidongyanJun 10, 2025
  25. pack-bitmap: remove checks before bitmap_freeLidong Yan via GitGitGadget, Jun 5, 2025
  26. Junio C HamanoJun 6, 2025
  27. lidongyanJun 6, 2025
  28. pack-bitmap: remove checks before bitmap_freeLidong Yan via GitGitGadget, Jun 9, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.