[Top][All Lists]

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

Re: [bug-gnu-libiconv] Address Sanitizer finding in libiconv_open iconv.

From: Bruno Haible
Subject: Re: [bug-gnu-libiconv] Address Sanitizer finding in libiconv_open iconv.c:234
Date: Sun, 12 May 2019 14:20:27 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-145-generic; KDE/5.18.0; x86_64; ; )

Jeffrey Walton wrote:
> It should avoid failures with tooling like Asan.
> An improvement would be an Autoconf to check for
> __attribute__((destructor)), and then enable do_cleanup() for more
> compilers and platforms. I believe the Intel compiler on x86 and IBM
> XLC on AIX support the attribute.

Extra effort right before the termination of a program, just to silence
leak detectors, is discouraged by the GNU standards [1]:
  "if memory is used until just before a process exits, don’t free it
   simply to silence such a tool."

=> Won't do.

Just set the environment variable  ASAN_OPTIONS=detect_leaks=0,
and the address sanitizer will only report relevant findings,
not irrelevant things like left-over memory.


[1] https://www.gnu.org/prep/standards/html_node/Memory-Usage.html

reply via email to

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