Discussion:
gnulib's malloca use under valgrind
(too old to reply)
Nikos Mavrogiannopoulos
2017-03-17 08:23:13 UTC
Permalink
Raw Message
Hi,
When we enabled running tests under valgrind in libidn2 [0] we found
out this issue, which involves the unistring/iconv part of the gnulib
code:

==3644== Conditional jump or move depends on uninitialised value(s)
==3644==    at 0x4E3EBCC: freea (malloca.c:134)
==3644==    by 0x4E40C1D: mem_iconveha (striconveha.c:255)
==3644==    by 0x4E40E36: u8_conv_from_encoding (u8-conv-from-enc.c:98)
==3644==    by 0x4E41017: u8_strconv_from_encoding (u-strconv-from-
enc.h:34)
==3644==    by 0x4E3BDA2: idn2_lookup_ul (lookup.c:454)
==3644==    by 0x10C1CD: test_homebrewed (test-lookup.c:941)
==3644==    by 0x10C1CD: main (test-lookup.c:1177)

The warning seems to be caused by the malloca() use on this function.
Replacing with malloc(), free() eliminates the uninitialized value
error. Is that warning something expected from the malloca
implementation in gnulib? Should we simply ignore that error via a
valgrind suppression?

regards,
Nikos

[0]. https://gitlab.com/libidn/libidn2/issues/11
Bruno Haible
2017-03-17 13:00:14 UTC
Permalink
Raw Message
Hi Nikos,
Post by Nikos Mavrogiannopoulos
When we enabled running tests under valgrind in libidn2 [0] we found
out this issue, which involves the unistring/iconv part of the gnulib
==3644== Conditional jump or move depends on uninitialised value(s)
==3644== at 0x4E3EBCC: freea (malloca.c:134)
==3644== by 0x4E40C1D: mem_iconveha (striconveha.c:255)
==3644== by 0x4E40E36: u8_conv_from_encoding (u8-conv-from-enc.c:98)
==3644== by 0x4E41017: u8_strconv_from_encoding (u-strconv-from-enc.h:34)
==3644== by 0x4E3BDA2: idn2_lookup_ul (lookup.c:454)
==3644== by 0x10C1CD: test_homebrewed (test-lookup.c:941)
==3644== by 0x10C1CD: main (test-lookup.c:1177)
The warning seems to be caused by the malloca() use on this function.
The 'malloca' module includes a file lib/malloca.valgrind. You can use this
file, with the valgrind option --suppressions, to make the warning disappear.

Bruno

Loading...