[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnu-libiconv] Address Sanitizer finding in libiconv_open iconv.
Re: [bug-gnu-libiconv] Address Sanitizer finding in libiconv_open iconv.c:234
Sat, 11 May 2019 01:14:40 -0400
On Mon, May 6, 2019 at 4:02 AM Bruno Haible <address@hidden> wrote:
> Hi Jeffrey,
> > I'm testing on Fedora 29, x86_64. I'm catching an address sanitizer
> > finding in libiconvert-1.16. It was present in 1.15, but I did not
> > investigate it. I'm using CFLAGS+=-fsanitize=address and
> > CXXFLAGS+=-fsanitize=address (and LDFLAGS+=-fsanitize=address as
> > needed).
> > ...
> > Direct leak of 288 byte(s) in 2 object(s) allocated from:
> > #0 0x7f75d3044c08 in __interceptor_malloc (/lib64/libasan.so.5+0xefc08)
> > #1 0x7f75d2e6b1b1 in libiconv_open iconv.c:234
> The memory allocation at iconv.c:234 is the one that allocates a
> conversion descriptor (iconv_t). If you see this one occur as a
> "memory leak", it means that the caller of iconv_open() did not call
> iconv_close() on the result.
> This might be OK for a test program. See the last paragraph of
I'm trying to build GnuPG, which depends upon iconv. Everything is
being built with Asan for testing.
It looks like iconv is causing GnuPG configuration tests to fail:
checking if gcc supports -Wpointer-arith... yes
checking whether "make check" shall run all tests... no
*** The system does not provide a working iconv function. Please
*** install a suitable library; for example GNU Libiconv which is
*** available at:
*** Required libraries not found. Please consult the above messages
*** and install them before running configure again.
iconv is there, it is just causing a build error.
I've seen the same behavior with OpenSSL. OpenSSL fails Asan and
UBsan, and it causes libunistring and ldns to fail during