Page MenuHome GnuPG

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

Details

Version
1.6.3

Event Timeline

JW set Version to 1.6.3.
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).

27503==ERROR: LeakSanitizer: detected memory leaks

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

#0 0x49f53b in malloc

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

#1 0x53a9ca in _gcry_private_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x53a9ca)

#2 0x4f2e00 in do_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x4f2e00)

#3 0x4f289a in _gcry_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x4f289a)

#4 0x4f5349 in _gcry_xmalloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x4f5349)

#5 0xc7ade0 in _gcry_mpi_alloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0xc7ade0)

#6 0xc8c6ac in _gcry_mpi_set_ui

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0xc8c6ac)

#7 0x4c9d2b in gcry_mpi_set_ui

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x4c9d2b)

#8 0x4bd295 in test_const_and_immutable

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x4bd295)

#9 0x4bd0fb in main

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x4bd0fb)

#10 0x2abeb5528ec4 in __libc_start_main

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

Indirect leak of 8 byte(s) in 1 object(s) allocated from:

#0 0x49f53b in malloc

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

#1 0x53a9ca in _gcry_private_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x53a9ca)

#2 0x4f2e00 in do_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x4f2e00)

#3 0x4f289a in _gcry_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x4f289a)

#4 0x4f5349 in _gcry_xmalloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x4f5349)

#5 0xc7b998 in _gcry_mpi_alloc_limb_space

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0xc7b998)

#6 0xc7aef4 in _gcry_mpi_alloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0xc7aef4)

#7 0xc8c6ac in _gcry_mpi_set_ui

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0xc8c6ac)

#8 0x4c9d2b in gcry_mpi_set_ui

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x4c9d2b)

#9 0x4bd295 in test_const_and_immutable

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x4bd295)

#10 0x4bd0fb in main

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/mpitests+0x4bd0fb)

#11 0x2abeb5528ec4 in __libc_start_main

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

SUMMARY: AddressSanitizer: 32 byte(s) leaked in 2 allocation(s).
FAIL: mpitests
./tsexp: /lib/x86_64-linux-gnu/libgpg-error.so.0: no version information
available (required by ./tsexp)

27510==ERROR: LeakSanitizer: detected memory leaks

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

#0 0x49f53b in malloc

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

#1 0x548dfa in _gcry_private_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x548dfa)

#2 0x501230 in do_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x501230)

#3 0x500cca in _gcry_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x500cca)

#4 0x50fffa in _gcry_sexp_find_token

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x50fffa)

#5 0x4d62cb in gcry_sexp_find_token

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x4d62cb)

#6 0x4cc1ad in bug_1594

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x4cc1ad)

#7 0x4bcf62 in main

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x4bcf62)

#8 0x2ad398718ec4 in __libc_start_main

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

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

#0 0x49f53b in malloc

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

#1 0x548dfa in _gcry_private_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x548dfa)

#2 0x501230 in do_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x501230)

#3 0x500cca in _gcry_malloc

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x500cca)

#4 0x50fffa in _gcry_sexp_find_token

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x50fffa)

#5 0x4d62cb in gcry_sexp_find_token

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x4d62cb)

#6 0x4cc295 in bug_1594

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x4cc295)

#7 0x4bcf62 in main

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/tsexp+0x4bcf62)

#8 0x2ad398718ec4 in __libc_start_main

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

SUMMARY: AddressSanitizer: 1081 byte(s) leaked in 2 allocation(s).
FAIL: tsexp

27657==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 144560 byte(s) in 278 object(s) allocated from:

#0 0x49f690 in calloc

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

#1 0x4c3020 in do_slope_benchmark

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4c3020)

#2 0x4d2030 in cipher_bench_one

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4d2030)

#3 0x4c6565 in _cipher_bench

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4c6565)

#4 0x4c5d96 in cipher_bench

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4c5d96)

#5 0x4cb103 in main

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4cb103)

#6 0x2b9df664dec4 in __libc_start_main

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

Direct leak of 15080 byte(s) in 29 object(s) allocated from:

#0 0x49f690 in calloc

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

#1 0x4c3020 in do_slope_benchmark

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4c3020)

#2 0x4cc4ea in mac_bench_one

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4cc4ea)

#3 0x4c86db in _mac_bench

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4c86db)

#4 0x4c819a in mac_bench

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4c819a)

#5 0x4cb0ef in main

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4cb0ef)

#6 0x2b9df664dec4 in __libc_start_main

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

Direct leak of 9360 byte(s) in 18 object(s) allocated from:

#0 0x49f690 in calloc

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

#1 0x4c3020 in do_slope_benchmark

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4c3020)

#2 0x4cfd7a in hash_bench_one

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4cfd7a)

#3 0x4c773b in _hash_bench

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4c773b)

#4 0x4c6e0a in hash_bench

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4c6e0a)

#5 0x4cb0db in main

(/home/gpg-user/gcrypt-2.0-sanitize/libgcrypt-1.6.3/tests/bench-slope+0x4cb0db)

#6 0x2b9df664dec4 in __libc_start_main

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

SUMMARY: AddressSanitizer: 169000 byte(s) leaked in 325 allocation(s).
FAIL: bench-slope

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)

Changed status to 'unread'. I am not chatting.

Please take it to gnupg-devel and use master for fuzzing.

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