Date: Mon, 30 Jun 2025 07:26:01 -0700
From: Stephen Gildea <[email protected]>
Message-ID: <[email protected]>
| I agree with Robert that we don't care if a program allocates
| a lot of memory that it doesn't free before exiting. And I'm
| not proposing to change that, which would, as Robert points
| out, make the code more complicated for no performance gain.
No, that wasn't quite my point.
| 2) make it easier to find leaks we do care about.
My point was that I see no evidence that there are any (however
poor Ken believes the internal API's to be, which I won't comment on)
| I invite people to study the sample patch in my proposal.
I did, it simply moved a variable declaration from being local
to main() to being global (static) - which has 2 effects, first
it forces the reader to look and see where else (in this source
file) the variable is being used, and second, it defeats many
optimisation choices the compiler can make with local variables.
| And yes, there are leaks we care about.
No, what you mean is that there could possibly be leaks that
we would care about if they existed. Not that any leaks like
that actually exist.
Note that there is not (really cannot be) any objection to your
changing your copy of the code in any way that you like, and
running whatever sanitisers on the result that you can make work.
Then if you find any real problems, that would be great, and lead
to fixes (either proposed by you and tested with the sanitiser, or
made by someone else) - you don't need to ask for permission from
anyone to do that.
My guess is that you would be wasting your time. The kind of changes
that Ken hinted at would be something entirely different.
kre
ps: why asan would treat what is still referred to by global vars
specially when the program exits, but not ones which were referred
to by locals inside main() (which have precisely the same lifetime)
makes no sense to me at all.