Bug#725522: libgnutls28: memory leak calling gnutls_global_init/gnutls_global_deinit

2013-10-07 Thread Tim Ruehsen
On Sunday 06 October 2013 22:47:28 Daniel Kahn Gillmor wrote:
 On 10/06/2013 03:30 PM, Tim Rühsen wrote:
  Package: libgnutls28
  Version: 3.2.4-4
  Severity: normal
  
  Dear Maintainer,
  
  calling gnutls_global_init() followed by gnutls_global_deinit() leaves one
  memory chunk
 
  unfreed. That's what valgrind says:

 This looks to me like it might be quite similar to
 http://bugs.debian.org/700899 -- what version of valgrind are you running?
 
 see also
 http://lists.freedesktop.org/archives/p11-glue/2013-February/000263.html

Yes, it looks like the same bug.
My valgrind is 3.8.1-5.

BTW, bug #700899 is not solved here.
Your dlopentest.c still behaves as you described in the original bug report 
though the valgrind suppression is there in/usr/lib/valgrind/debian.supp:

{
  dlopen() with -lpthread bug#700899
  Memcheck:Leak
  fun:calloc
  fun:_dlerror_run
  fun:dlopen@@GLIBC_2.2.5
}

Valgrind still says:
==18794== in use at exit: 32 bytes in 1 blocks
==18794==   total heap usage: 6 allocs, 5 frees, 1,518 bytes allocated
==18794== 
==18794== 32 bytes in 1 blocks are still reachable in loss record 1 of 1
==18794==at 0x4C2B514: calloc (vg_replace_malloc.c:593)
==18794==by 0x505065F: _dlerror_run (dlerror.c:141)
==18794==by 0x50500C0: dlopen@@GLIBC_2.2.5 (dlopen.c:87)

Out of curiosity, I copied the suppression from debian.supp to debian-libc6-
dbg.supp. And voila, that works !

Looks like valgrind is not reading debian.supp correctly !?

Tim


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#725522: libgnutls28: memory leak calling gnutls_global_init/gnutls_global_deinit

2013-10-07 Thread Alessandro Ghedini
On lun, ott 07, 2013 at 09:54:17 +0200, Tim Ruehsen wrote:
 On Sunday 06 October 2013 22:47:28 Daniel Kahn Gillmor wrote:
  On 10/06/2013 03:30 PM, Tim Rühsen wrote:
   Package: libgnutls28
   Version: 3.2.4-4
   Severity: normal
   
   Dear Maintainer,
   
   calling gnutls_global_init() followed by gnutls_global_deinit() leaves one
   memory chunk
  
   unfreed. That's what valgrind says:
 
  This looks to me like it might be quite similar to
  http://bugs.debian.org/700899 -- what version of valgrind are you running?
  
  see also
  http://lists.freedesktop.org/archives/p11-glue/2013-February/000263.html
 
 Yes, it looks like the same bug.
 My valgrind is 3.8.1-5.
 
 BTW, bug #700899 is not solved here.
 Your dlopentest.c still behaves as you described in the original bug report 
 though the valgrind suppression is there in/usr/lib/valgrind/debian.supp:
 
 {
   dlopen() with -lpthread bug#700899
   Memcheck:Leak
   fun:calloc
   fun:_dlerror_run
   fun:dlopen@@GLIBC_2.2.5
 }
 
 Valgrind still says:
 ==18794== in use at exit: 32 bytes in 1 blocks
 ==18794==   total heap usage: 6 allocs, 5 frees, 1,518 bytes allocated
 ==18794== 
 ==18794== 32 bytes in 1 blocks are still reachable in loss record 1 of 1
 ==18794==at 0x4C2B514: calloc (vg_replace_malloc.c:593)
 ==18794==by 0x505065F: _dlerror_run (dlerror.c:141)
 ==18794==by 0x50500C0: dlopen@@GLIBC_2.2.5 (dlopen.c:87)
 
 Out of curiosity, I copied the suppression from debian.supp to debian-libc6-
 dbg.supp. And voila, that works !
 
 Looks like valgrind is not reading debian.supp correctly !?

Did you tell valgrind to load it? It doesn't load any suppression file by
default and never has (except debian-libc6-dbg.supp, but that's useless anyway
and will be removed in the future).

Maybe a note in valgrind's README.Debian would help clearing the confusion?

Cheers

-- 
perl -E '$_=q;$/= @{[@_]};and s;\S+;inidehG ordnasselA;eg;say~~reverse'


signature.asc
Description: Digital signature


Bug#725522: libgnutls28: memory leak calling gnutls_global_init/gnutls_global_deinit

2013-10-07 Thread Tim Ruehsen

  Out of curiosity, I copied the suppression from debian.supp to
  debian-libc6- dbg.supp. And voila, that works !
  
  Looks like valgrind is not reading debian.supp correctly !?
 
 Did you tell valgrind to load it? It doesn't load any suppression file by
 default and never has (except debian-libc6-dbg.supp, but that's useless
 anyway and will be removed in the future).

Sorry, I thought it loads any *.supp files in /usr/lib/valgrind/.

 Maybe a note in valgrind's README.Debian would help clearing the confusion?

Yes, definitely. That would be helpful.

Please excuse my confusion...

Tim


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#725522: libgnutls28: memory leak calling gnutls_global_init/gnutls_global_deinit

2013-10-06 Thread Tim Rühsen
Package: libgnutls28
Version: 3.2.4-4
Severity: normal

Dear Maintainer,

calling gnutls_global_init() followed by gnutls_global_deinit() leaves one 
memory chunk
unfreed. That's what valgrind says:

==17498== HEAP SUMMARY:
==17498== in use at exit: 32 bytes in 1 blocks
==17498==   total heap usage: 2,198 allocs, 2,197 frees, 324,240 bytes 
allocated
==17498== 
==17498== 32 bytes in 1 blocks are still reachable in loss record 1 of 1
==17498==at 0x4C2B514: calloc (vg_replace_malloc.c:593)
==17498==by 0x620865F: _dlerror_run (dlerror.c:141)
==17498==by 0x62080C0: dlopen@@GLIBC_2.2.5 (dlopen.c:87)
==17498==by 0x5703ACA: dlopen_and_get_function_list (in /usr/lib/x86_64-
linux-gnu/libp11-kit.so.0.0.0)
==17498==by 0x5704909: _p11_kit_initialize_registered_unlocked_reentrant 
(in /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0)
==17498==by 0x5704CCC: p11_kit_initialize_registered (in /usr/lib/x86_64-
linux-gnu/libp11-kit.so.0.0.0)
==17498==by 0x4E88037: gnutls_pkcs11_init (in /usr/lib/x86_64-linux-
gnu/libgnutls.so.28.25.0)
==17498==by 0x4E719A2: gnutls_global_init (in /usr/lib/x86_64-linux-
gnu/libgnutls.so.28.25.0)
==17498==by 0x4006F5: main (in /home/tim/src/mget/tmp/x)

It may be in libp11-kit0 or even in libc6, but that is beyond of my current 
scope.

C source to reproduce the leak:
#include stdio.h
#include gnutls/gnutls.h
void main(void) {
  gnutls_global_init();
  gnutls_global_deinit();
}


-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libgnutls28 depends on:
ii  libc6  2.17-93
ii  libgmp10   2:5.1.2+dfsg-3
ii  libhogweed22.7.1-1
ii  libnettle4 2.7.1-1
ii  libp11-kit00.18.5-3
ii  libtasn1-6 3.3-2
ii  multiarch-support  2.17-93
ii  zlib1g 1:1.2.8.dfsg-1

libgnutls28 recommends no packages.

Versions of packages libgnutls28 suggests:
ii  gnutls-bin  3.2.4-4

-- no debconf information


signature.asc
Description: This is a digitally signed message part.


Bug#725522: libgnutls28: memory leak calling gnutls_global_init/gnutls_global_deinit

2013-10-06 Thread Daniel Kahn Gillmor
On 10/06/2013 03:30 PM, Tim Rühsen wrote:
 Package: libgnutls28
 Version: 3.2.4-4
 Severity: normal
 
 Dear Maintainer,
 
 calling gnutls_global_init() followed by gnutls_global_deinit() leaves one 
 memory chunk
 unfreed. That's what valgrind says:

Hi Tim--

This looks to me like it might be quite similar to
http://bugs.debian.org/700899 -- what version of valgrind are you running?

see also
http://lists.freedesktop.org/archives/p11-glue/2013-February/000263.html

--dkg



signature.asc
Description: OpenPGP digital signature