Page MenuHome GnuPG

Memory leaks when running `make check` under Clang sanitizers
Closed, ResolvedPublic

Description

...
PASS: pipeconnect
fdpassing[29647]: chan_4 -> OK Pleased to meet you, process 29646
fdpassing[29647]: chan_4 <- # descriptor 4 is in flight
fdpassing[29647]: chan_4 <- INPUT FD
fdpassing[29647]: chan_4 -> OK
fdpassing[29647]: chan_4 <- ECHO
fdpassing[29647]: chan_4 -> OK
fdpassing[29647]: chan_4 <- # descriptor 4 is in flight
fdpassing[29647]: chan_4 <- INPUT FD
fdpassing[29647]: chan_4 -> OK
fdpassing[29647]: chan_4 <- ECHO
fdpassing[29647]: chan_4 -> OK
fdpassing[29647]: chan_4 <- # descriptor 4 is in flight
fdpassing[29647]: chan_4 <- INPUT FD
fdpassing[29647]: chan_4 -> OK
fdpassing[29647]: chan_4 <- ECHO
fdpassing[29647]: chan_4 -> OK
fdpassing[29647]: chan_4 <- # descriptor 4 is in flight
fdpassing[29647]: chan_4 <- INPUT FD
fdpassing[29647]: chan_4 -> OK
fdpassing[29647]: chan_4 <- ECHO
fdpassing[29647]: chan_4 -> OK
fdpassing[29647]: chan_4 <- # descriptor 4 is in flight
fdpassing[29647]: chan_4 <- INPUT FD
fdpassing[29647]: chan_4 -> OK
fdpassing[29647]: chan_4 <- ECHO
fdpassing[29647]: chan_4 -> OK
fdpassing[29647]: chan_4 <- # descriptor 4 is in flight
fdpassing[29647]: chan_4 <- INPUT FD
fdpassing[29647]: chan_4 -> OK
fdpassing[29647]: chan_4 <- ECHO
fdpassing[29647]: chan_4 -> OK
fdpassing[29647]: chan_4 <- BYE
fdpassing[29647]: chan_4 -> OK closing connection

29647==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 3784 byte(s) in 1 object(s) allocated from:

#0 0x49f1bb in __interceptor_malloc

/home/gpg-user/Clang-3.5/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:40:3

#1 0x4cfb93 in _assuan_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x4cfb93)

#2 0x4c6468 in assuan_new_ext

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x4c6468)

#3 0x4c7cbf in assuan_new

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x4c7cbf)

#4 0x4c18f6 in main

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x4c18f6)

#5 0x2af2ff616ec4 in __libc_start_main

/build/buildd/eglibc-2.19/csu/libc-start.c:287

Direct leak of 7 byte(s) in 1 object(s) allocated from:

#0 0x49f1bb in __interceptor_malloc

/home/gpg-user/Clang-3.5/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:40:3

#1 0x4bc9fd in xmalloc

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x4bc9fd)

#2 0x4be62e in prepend_srcdir

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x4be62e)

#3 0x4c0326 in main

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x4c0326)

#4 0x2af2ff616ec4 in __libc_start_main

/build/buildd/eglibc-2.19/csu/libc-start.c:287

SUMMARY: AddressSanitizer: 3791 byte(s) leaked in 2 allocation(s).

29646==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 12 byte(s) in 1 object(s) allocated from:

#0 0x49f1bb in __interceptor_malloc

/home/gpg-user/Clang-3.5/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:40:3

#1 0x4cfb93 in _assuan_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x4cfb93)

#2 0x537997 in socketpair_connect

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x537997)

#3 0x5362ca in assuan_pipe_connect

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x5362ca)

#4 0x4c1af7 in main

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x4c1af7)

#5 0x2af2ff616ec4 in __libc_start_main

/build/buildd/eglibc-2.19/csu/libc-start.c:287

Direct leak of 7 byte(s) in 1 object(s) allocated from:

#0 0x49f1bb in __interceptor_malloc

/home/gpg-user/Clang-3.5/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:40:3

#1 0x4bc9fd in xmalloc

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x4bc9fd)

#2 0x4be62e in prepend_srcdir

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x4be62e)

#3 0x4c0326 in main

(/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing+0x4c0326)

#4 0x2af2ff616ec4 in __libc_start_main

/build/buildd/eglibc-2.19/csu/libc-start.c:287

SUMMARY: AddressSanitizer: 19 byte(s) leaked in 2 allocation(s).

FAIL: fdpassing

1 of 3 tests failed
make[3]: *** [check-TESTS] Error 1

Please report to http://bugs.gnupg.org

make[2]: * [check-am] Error 2
make[3]: Leaving directory
`/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests'
make[2]: Leaving directory
`/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests'
make[1]:
* [check] Error 2
make[1]: Leaving directory
`/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests'
make: *** [check-recursive] Error 1

Details

Version
2.2.0

Event Timeline

JW added projects: libassuan, Bug Report.
JW added a subscriber: JW.

Attached is the script I am using to acceptance test the suite. It requires
Clang 3.5 (Clang 3.5 recipe was provided with Bug 1872).

Here's the updated output with line numbers.

51121==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 12 byte(s) in 1 object(s) allocated from:

#0 0x49f22b in __interceptor_malloc

/home/gpg-user/Clang-3.5/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:40:3

#1 0x4dc25a in socketpair_connect

/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/src/assuan-pipe-connect.c:317:15

#2 0x4bdec1 in main

/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing.c:291:13

#3 0x2afdc8bddec4 in __libc_start_main

/build/buildd/eglibc-2.19/csu/libc-start.c:287

Direct leak of 7 byte(s) in 1 object(s) allocated from:

#0 0x49f22b in __interceptor_malloc

/home/gpg-user/Clang-3.5/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:40:3

#1 0x4bc978 in xmalloc

/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/./common.h:62:13

#2 0x2afdc8bddec4 in __libc_start_main

/build/buildd/eglibc-2.19/csu/libc-start.c:287

SUMMARY: AddressSanitizer: 19 byte(s) leaked in 2 allocation(s).

51122==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 3784 byte(s) in 1 object(s) allocated from:

#0 0x49f22b in __interceptor_malloc

/home/gpg-user/Clang-3.5/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:40:3

#1 0x4bed76 in assuan_new_ext

/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/src/assuan.c:134:11

#2 0x4bde6f in main

/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/fdpassing.c:287:13

#3 0x2afdc8bddec4 in __libc_start_main

/build/buildd/eglibc-2.19/csu/libc-start.c:287

Direct leak of 7 byte(s) in 1 object(s) allocated from:

#0 0x49f22b in __interceptor_malloc

/home/gpg-user/Clang-3.5/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:40:3

#1 0x4bc978 in xmalloc

/home/gpg-user/gcrypt-2.0-sanitize/libassuan-2.2.0/tests/./common.h:62:13

#2 0x2afdc8bddec4 in __libc_start_main

/build/buildd/eglibc-2.19/csu/libc-start.c:287

SUMMARY: AddressSanitizer: 3791 byte(s) leaked in 2 allocation(s).
FAIL: fdpassing

Updated status to 'unread'. I'm not chatting.

Updated status to 'unread'. I'm not chatting.

Plerase write proper bug reports or discuss at gnupg-devel. Thanks.

werner claimed this task.
werner added a project: Mistaken.