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

Re: [PATCH] Add MALLOC_CHECK_ and MALLOC_PERTURB_ libc env to the test suite for detecting heap corruption

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 13, 2012, 17:46 UTC
Message-ID
<7vvcfh95o9.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CA+EOSBmjwUA_Sogo5ZixnAE5_6C97wjEOzO6PnDgjw_BYzVz-w@mail.gmail.com>
Elia Pinto <gitter.spiros@gmail.com> writes:
Show 8 quoted lines
> 2012/9/12 Junio C Hamano <gitster@pobox.com>:
>>
>> Interesting, but it bothers me to make it enabled unconditionally.
>> At least, this shouldn't be enabled under GIT_TEST_OPTS=--valgrind, no?
> Sorry for the late response and thanks.
>
> No, setting MALLOC_CHECK don't require
> valgrind ...
You never said anything like that, and I didn't question it.
> and it considered a best QA to have the test suite with it
> defined always. If the test suite fail with MALLOC_CHECK, well, there
> is some problem, no ?
I never said using MALLOC_CHECK_ is a bad idea.

Let me ask the same question in a different way, as I seem to have failed in the previous message.

If you are using valgrind to run tests, is it sane to also enable MALLOC_CHECK? If you were testing "cat", would it make sense to do:

	$ MALLOC_CHECK_=3 valgrind cat README

Because we are not interested in testing how valgrind (not cat) uses malloc, we may be better off running

	$ valgrind cat README

without MALLOC_CHECK_; it will reduce the risk of MALLOC_CHECK_ potentially disturbing what we really want to check (i.e. cat) by triggering for something whose problems we are not trying to see (i.e. valgrind), no?

That was my question.
Previous: Elia Pinto
Message 4 of 4 in “Add MALLOC_CHECK_ and MALLOC_PERTURB_ libc env to the test suite for detecting heap corruption”
  1. Add MALLOC_CHECK_ and MALLOC_PERTURB_ libc env to the test suite for detecting heap corruptionElia Pinto, Sep 12, 2012
  2. Junio C HamanoSep 12, 2012
  3. Elia PintoSep 13, 2012
  4. Junio C HamanoSep 13, 2012

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.