bug-gnulib
[Top][All Lists]
Advanced

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

memory leaks in gnulib tests (for ASAN/LINT)


From: Assaf Gordon
Subject: memory leaks in gnulib tests (for ASAN/LINT)
Date: Tue, 9 Oct 2018 07:52:35 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Hello gnulib,

'deltatau' recently reported 3 memory leaks detected in gnulib's test in
sed [1]. This was found using our recent ASAN build feature [2].

[1] https://bugs.gnu.org/32685
[2] https://git.savannah.gnu.org/cgit/sed.git/commit/?id=0cc0ade4237b8db69f5253c3d933f9890b698f4d

It is a long tradition not to bother freeing memory in such cases,
but perhaps it's worth considering IF_LINT(free(...))
to help more automated/ASAN testing?

Details below.

regards,
 - assaf



FAIL: test-copy-acl.sh
======================

+ test 1 = 0
+ func_tmpdir
+ : /tmp
+ tmp=/tmp/glg11kSA
+ test -n /tmp/glg11kSA
+ test -d /tmp/glg11kSA
++ pwd
+ builddir=/home/ksk/delete/sed-build-asan/gnulib-tests
+ cd /home/ksk/delete/sed-build-asan/gnulib-tests
+ cd /tmp/glg11kSA
+ rm -f 'tmpfile[0-9]' 'tmpaclout[0-2]'
+ echo 'Simple contents'
+ chmod 600 tmpfile0
+ acl_flavor=none
+ acl_flavor=linux
+ case $acl_flavor in
+ func_test_copy tmpfile0 tmpfile1
+ echo 'Simple contents'
+ chmod 600 tmpfile1
+ /home/ksk/delete/sed-build-asan/gnulib-tests/test-copy-acl tmpfile0 tmpfile1 + /home/ksk/delete/sed-build-asan/gnulib-tests/test-sameacls tmpfile0 tmpfile1

=================================================================
==26800==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 108 byte(s) in 2 object(s) allocated from:
#0 0x7fa615dbe019 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:86
    #1 0x7fa615ac851b  (/usr/lib/libacl.so.1+0x451b)
    #2 0x7fa615924222 in __libc_start_main (/usr/lib/libc.so.6+0x24222)

Direct leak of 17 byte(s) in 1 object(s) allocated from:
#0 0x7fa615dbe019 in __interceptor_malloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:86 #1 0x563664a51531 in fread_file /home/ksk/delete/sed-build-asan/gnulib-tests/read-file.c:73 #2 0x563664a51908 in internal_read_file /home/ksk/delete/sed-build-asan/gnulib-tests/read-file.c:147 #3 0x563664a51a36 in read_file /home/ksk/delete/sed-build-asan/gnulib-tests/read-file.c:174 #4 0x563664a50545 in main /home/ksk/delete/sed-build-asan/gnulib-tests/test-sameacls.c:58
    #5 0x7fa615924222 in __libc_start_main (/usr/lib/libc.so.6+0x24222)

[...]



reply via email to

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