git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: lidongyan <502024330056@smail.nju.edu.cn>
Cc: Lidong Yan via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org,  Patrick Steinhardt <ps@pks.im>,
	 Eric Sunshine <sunshine@sunshineco.com>
Subject: Re: [PATCH v3] pack-bitmap: remove checks before bitmap_free
Date: Wed, 04 Jun 2025 05:32:35 -0700	[thread overview]
Message-ID: <xmqqcybjg00s.fsf@gitster.g> (raw)
In-Reply-To: <B7032488-F47A-46B9-AF9C-D059AFC31FE8@smail.nju.edu.cn> (lidongyan's message of "Tue, 3 Jun 2025 23:32:23 +0800")

lidongyan <502024330056@smail.nju.edu.cn> writes:

> 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.


  reply	other threads:[~2025-06-04 12:32 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-25  5:09 [PATCH] pack-bitmap: remove checks before bitmap_free Lidong Yan via GitGitGadget
2025-05-26  6:49 ` Patrick Steinhardt
2025-05-26 16:05   ` lidongyan
2025-05-30 18:14 ` [PATCH v2 0/2] " Lidong Yan via GitGitGadget
2025-05-30 18:14   ` [PATCH v2 1/2] " Lidong Yan via GitGitGadget
2025-05-30 18:14   ` [PATCH v2 2/2] t5333: test memory leak when use pseudo-merge in boundary traversal Lidong Yan via GitGitGadget
2025-05-30 21:42     ` Junio C Hamano
2025-05-30 21:50       ` Eric Sunshine
2025-05-31  3:18         ` lidongyan
2025-05-30 21:06   ` [PATCH v2 0/2] pack-bitmap: remove checks before bitmap_free Junio C Hamano
2025-06-03  1:46   ` [PATCH v3] " Lidong Yan via GitGitGadget
2025-06-03  6:12     ` Junio C Hamano
2025-06-03  6:22       ` lidongyan
2025-06-03 15:14         ` Junio C Hamano
2025-06-03 15:32           ` lidongyan
2025-06-04 12:32             ` Junio C Hamano [this message]
2025-06-04 12:43               ` lidongyan
2025-06-04 14:49                 ` Junio C Hamano
2025-06-03  6:20     ` [PATCH v4] " Lidong Yan via GitGitGadget
2025-06-03 22:09       ` Taylor Blau
2025-06-04  2:50         ` lidongyan
2025-06-05  6:24       ` [PATCH v5] " Lidong Yan via GitGitGadget
2025-06-05 15:29         ` Junio C Hamano
2025-06-10  5:58           ` lidongyan
2025-06-05 15:53         ` [PATCH v6] " Lidong Yan via GitGitGadget
2025-06-06  1:28           ` Junio C Hamano
2025-06-06  5:49             ` lidongyan
2025-06-09  8:18           ` [PATCH v7] " Lidong Yan via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqcybjg00s.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=502024330056@smail.nju.edu.cn \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=ps@pks.im \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).