bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory leaks in gnulib tests (for ASAN/LINT)


From: Bruno Haible
Subject: Re: memory leaks in gnulib tests (for ASAN/LINT)
Date: Tue, 09 Oct 2018 16:45:07 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-137-generic; KDE/5.18.0; x86_64; ; )

Hello Assaf

> It is a long tradition not to bother freeing memory in such cases

Yes. I remind the distinction between "not serious" and "serious"
memory leaks (as defined in https://en.wikipedia.org/wiki/Memory_leak ),
and I don't intend to do anything about the not serious ones.

Why?

1) Because there are cases where one-time allocation of memory is normal.
   For example the functions textdomain() and bindtextdomain() do allocate
   memory that stays allocated until the application ends. This is not
   a bug, because it does not lead to a serious memory leak.

2) In Gnulib we want to have a large number of unit tests. To achieve this,
   we should not make it too annoying to create unit tests. Therefore some
   sloppiness is allowed in unit tests that is not allowed in library code.

> to help more automated/ASAN testing?

It is the duty of the reporters to report as a bug only serious memory
leaks.

If you want to have automated testing against serious memory leaks, you need
to distinguish not serious and serious memory leaks. For example, by passing
--suppression options to valgrind, or by running test cases in a loop that
repeats them a 1000 times.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]