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

Re: Git 2.45.2 - memory leaks reports by address sanitizer (asan)

From
Jeff King <peff@peff.net>
Date
Jun 11, 2024, 08:14 UTC
Message-ID
<20240611081414.GH3248245@coredump.intra.peff.net>
In-Reply-To
<IA0PR14MB6188120169A3C05677F435A585C62@IA0PR14MB6188.namprd14.prod.outlook.com>
On Mon, Jun 10, 2024 at 02:37:05PM +0000, Janne Kiiskila wrote:
Show 9 quoted lines
> Seems to me there's a few potential issues:
> - GitHub runners hanging (it should not hang, it should exit with error).
> - Git itself having potential memory leaks.
> - I am misusing the LD_PRELOAD and it can not or does not as I expect?
>   (i.e. it should just slow down the execution, but not report any failures if there are no leaks/other issues).
> 
> I have checked the git repo itself and you do have already some
> address sanitizing test jobs in there so I would assume you do not
> have leaks. 

There are most definitely leaks in Git. In our ASan runs we set "detect_leaks=0" in ASAN_OPTIONS. We have a separate leak-checking build, but are working towards having it completely clean. In the meantime, individual scripts in our test suite are marked as leak-free (about half of them).

As far as your use of LD_PRELOAD, I'm not sure. Typically you'd compile with "-fsanitize=address", so the compiler is emitting extra code for the sanitizer, in addition to linking against libasan. I don't know enough about ASan to know whether just an LD_PRELOAD is enough to get useful results. But in general it makes sense to me to only set the LD_PRELOAD for the program you are interested in testing.

-Peff
Previous: Janne Kiiskila
Message 2 of 2 in “Git 2.45.2 - memory leaks reports by address sanitizer (asan)”
  1. Janne KiiskilaJun 10, 2024
  2. Jeff KingJun 11, 2024

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.