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