speechd-discuss
[Top][All Lists]
Advanced

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

WARNING possible mem leaks in libspeechd?


From: Halim Sahin
Subject: WARNING possible mem leaks in libspeechd?
Date: Wed, 12 Aug 2009 20:25:12 +0200

Hi,
Please help to solve this:
My testcase:
xyz.c:
#include<stdio.h>
#include <dlfcn.h>
#include <libspeechd.h>
#include <libspeechd.h>
#define SPEECHD "/usr/lib/libspeechd.so"

int main ()
{
  void *spd_libptr = dlopen (SPEECHD, RTLD_NOW | RTLD_GLOBAL);

  if (spd_libptr)
    dlclose (spd_libptr);
  else
   {
     printf ("couldn't load libspeechdlib\n");
     return 1;
   }

  return 0;
}

Compile with
gcc -o xyz -ldl -g -O0 xyz.c
valgrind -v --leak-check=full --show-reachable=yes ./xyz 2>jj
Here is the jj:

==30413== Memcheck, a memory error detector.
==30413== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==30413== Using LibVEX rev 1854, a library for dynamic binary translation.
==30413== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==30413== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation 
framework.
==30413== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==30413== 
--30413-- Command line
--30413--    ./xyz
--30413-- Startup, with flags:
--30413--    -v
--30413--    --leak-check=full
--30413--    --show-reachable=yes
--30413-- Contents of /proc/version:
--30413--   Linux version 2.6.26-2-686 (Debian 2.6.26-17lenny1) (dannf at 
debian.org) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP 
Sun Jul 26 21:25:33 UTC 2009
--30413-- Arch and hwcaps: X86, x86-sse1-sse2
--30413-- Page sizes: currently 4096, max supported 4096
--30413-- Valgrind library directory: /usr/lib/valgrind
--30413-- Reading syms from /lib/ld-2.7.so (0x4000000)
--30413-- Reading debug info from /lib/ld-2.7.so...
--30413-- ... CRC mismatch (computed 58c6dbf6 wanted 58db3c41)
--30413--    object doesn't have a symbol table
--30413-- Reading syms from /tmp/xyz (0x8048000)
--30413-- Reading syms from /usr/lib/valgrind/x86-linux/memcheck (0x38000000)
--30413--    object doesn't have a dynamic symbol table
--30413-- Reading suppressions file: /usr/lib/valgrind/default.supp
--30413-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_core.so 
(0x401E000)
--30413-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so 
(0x4020000)
--30413-- Reading syms from /lib/i686/cmov/libdl-2.7.so (0x4047000)
--30413-- Reading debug info from /lib/i686/cmov/libdl-2.7.so...
--30413-- ... CRC mismatch (computed b596727c wanted ea21a73b)
--30413--    object doesn't have a symbol table
--30413-- Reading syms from /lib/i686/cmov/libc-2.7.so (0x404B000)
--30413-- Reading debug info from /lib/i686/cmov/libc-2.7.so...
--30413-- ... CRC mismatch (computed a0883b5e wanted 29618316)
--30413--    object doesn't have a symbol table
--30413-- REDIR: 0x40c1800 (rindex) redirected to 0x40240c0 (rindex)
--30413-- REDIR: 0x40bd5c0 (malloc) redirected to 0x4023cb0 (malloc)
--30413-- REDIR: 0x40bd2b0 (calloc) redirected to 0x4021d60 (calloc)
--30413-- Reading syms from /usr/lib/libspeechd.so.2.1.0 (0x4027000)
--30413--    object doesn't have a symbol table
--30413-- Reading syms from /lib/i686/cmov/libpthread-2.7.so (0x402E000)
--30413-- Reading debug info from /lib/i686/cmov/libpthread-2.7.so...
--30413-- ... CRC mismatch (computed c3db62fb wanted adf1206e)
--30413-- Reading syms from /usr/lib/libglib-2.0.so.0.1600.6 (0x45C7000)
--30413-- Reading debug info from /usr/lib/libglib-2.0.so.0.1600.6...
--30413-- ... CRC mismatch (computed 04fe816d wanted 10363805)
--30413--    object doesn't have a symbol table
--30413-- Reading syms from /usr/lib/libpcre.so.3.12.1 (0x467C000)
--30413-- Reading debug info from /usr/lib/libpcre.so.3.12.1...
--30413-- ... CRC mismatch (computed 4316786f wanted a7b655e4)
--30413--    object doesn't have a symbol table
--30413-- Discarding syms at 0x4027000-0x402E000 in 
/usr/lib/libspeechd.so.2.1.0 due to munmap()
--30413-- REDIR: 0x40bb790 (free) redirected to 0x4022ad0 (free)
--30413-- Discarding syms at 0x45C7000-0x467C000 in 
/usr/lib/libglib-2.0.so.0.1600.6 due to munmap()
--30413-- Discarding syms at 0x467C000-0x46A5000 in /usr/lib/libpcre.so.3.12.1 
due to munmap()
==30413== 
==30413== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 39 from 2)
--30413-- 
--30413-- supp:     35 dl-hack3-cond-1
--30413-- supp:      4 dl-hack5-32bit-addr-1
==30413== malloc/free: in use at exit: 1,166 bytes in 7 blocks.
==30413== malloc/free: 22 allocs, 15 frees, 3,657 bytes allocated.
==30413== 
==30413== searching for pointers to 7 not-freed blocks.
==30413== checked 83,840 bytes.
==30413== 
==30413== 16 bytes in 1 blocks are still reachable in loss record 1 of 7
==30413==    at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==30413==    by 0x4012A57: (within /lib/ld-2.7.so)
==30413==    by 0x4013266: (within /lib/ld-2.7.so)
==30413==    by 0x4047CC3: (within /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x404805B: (within /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x4047CF9: dlclose (in /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x80484AC: main (xyz.c:12)
==30413== 
==30413== 
==30413== 28 bytes in 1 blocks are still reachable in loss record 2 of 7
==30413==    at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==30413==    by 0x400C28B: (within /lib/ld-2.7.so)
==30413==    by 0x4011BA6: (within /lib/ld-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x401154D: (within /lib/ld-2.7.so)
==30413==    by 0x4047C2B: (within /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x404805B: (within /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x4047B60: dlopen (in /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x8048498: main (xyz.c:9)
==30413== 
==30413== 
==30413== 31 bytes in 1 blocks are still reachable in loss record 3 of 7
==30413==    at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==30413==    by 0x400A551: (within /lib/ld-2.7.so)
==30413==    by 0x4005FB2: (within /lib/ld-2.7.so)
==30413==    by 0x4007E0C: (within /lib/ld-2.7.so)
==30413==    by 0x400D0F6: (within /lib/ld-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x400C21C: (within /lib/ld-2.7.so)
==30413==    by 0x4011BA6: (within /lib/ld-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x401154D: (within /lib/ld-2.7.so)
==30413==    by 0x4047C2B: (within /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413== 
==30413== 
==30413== 31 bytes in 1 blocks are still reachable in loss record 4 of 7
==30413==    at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==30413==    by 0x4004D7E: (within /lib/ld-2.7.so)
==30413==    by 0x400809B: (within /lib/ld-2.7.so)
==30413==    by 0x400D0F6: (within /lib/ld-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x400C21C: (within /lib/ld-2.7.so)
==30413==    by 0x4011BA6: (within /lib/ld-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x401154D: (within /lib/ld-2.7.so)
==30413==    by 0x4047C2B: (within /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x404805B: (within /lib/i686/cmov/libdl-2.7.so)
==30413== 
==30413== 
==30413== 72 bytes in 1 blocks are still reachable in loss record 5 of 7
==30413==    at 0x4023D6E: malloc (vg_replace_malloc.c:207)
==30413==    by 0x40118BF: (within /lib/ld-2.7.so)
==30413==    by 0x4011DAE: (within /lib/ld-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x401154D: (within /lib/ld-2.7.so)
==30413==    by 0x4047C2B: (within /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x404805B: (within /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x4047B60: dlopen (in /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x8048498: main (xyz.c:9)
==30413== 
==30413== 
==30413== 368 bytes in 1 blocks are still reachable in loss record 6 of 7
==30413==    at 0x4021E22: calloc (vg_replace_malloc.c:397)
==30413==    by 0x400F44D: (within /lib/ld-2.7.so)
==30413==    by 0x4011E3E: (within /lib/ld-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x401154D: (within /lib/ld-2.7.so)
==30413==    by 0x4047C2B: (within /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x404805B: (within /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x4047B60: dlopen (in /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x8048498: main (xyz.c:9)
==30413== 
==30413== 
==30413== 620 bytes in 1 blocks are still reachable in loss record 7 of 7
==30413==    at 0x4021E22: calloc (vg_replace_malloc.c:397)
==30413==    by 0x400A2EA: (within /lib/ld-2.7.so)
==30413==    by 0x4005FB2: (within /lib/ld-2.7.so)
==30413==    by 0x4007E0C: (within /lib/ld-2.7.so)
==30413==    by 0x400D0F6: (within /lib/ld-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x400C21C: (within /lib/ld-2.7.so)
==30413==    by 0x4011BA6: (within /lib/ld-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413==    by 0x401154D: (within /lib/ld-2.7.so)
==30413==    by 0x4047C2B: (within /lib/i686/cmov/libdl-2.7.so)
==30413==    by 0x400DA15: (within /lib/ld-2.7.so)
==30413== 
==30413== LEAK SUMMARY:
==30413==    definitely lost: 0 bytes in 0 blocks.
==30413==      possibly lost: 0 bytes in 0 blocks.
==30413==    still reachable: 1,166 bytes in 7 blocks.
==30413==         suppressed: 0 bytes in 0 blocks.
--30413--  memcheck: sanity checks: 1 cheap, 2 expensive
--30413--  memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--30413--  memcheck: auxmaps_L1: 0 searches, 0 cmps, ratio 0:10
--30413--  memcheck: auxmaps_L2: 0 searches, 0 nodes
--30413--  memcheck: SMs: n_issued      = 11 (176k, 0M)
--30413--  memcheck: SMs: n_deissued    = 0 (0k, 0M)
--30413--  memcheck: SMs: max_noaccess  = 65535 (1048560k, 1023M)
--30413--  memcheck: SMs: max_undefined = 0 (0k, 0M)
--30413--  memcheck: SMs: max_defined   = 36 (576k, 0M)
--30413--  memcheck: SMs: max_non_DSM   = 11 (176k, 0M)
--30413--  memcheck: max sec V bit nodes:    0 (0k, 0M)
--30413--  memcheck: set_sec_vbits8 calls: 0 (new: 0, updates: 0)
--30413--  memcheck: max shadow mem size:   480k, 0M
--30413-- translate:            fast SP updates identified: 2,287 ( 90.2%)
--30413-- translate:   generic_known SP updates identified: 131 (  5.1%)
--30413-- translate: generic_unknown SP updates identified: 116 (  4.5%)
--30413--     tt/tc: 4,731 tt lookups requiring 4,760 probes
--30413--     tt/tc: 4,731 fast-cache updates, 5 flushes
--30413--  transtab: new        2,241 (47,346 -> 692,960; ratio 146:10) [0 scs]
--30413--  transtab: dumped     0 (0 -> ??)
--30413--  transtab: discarded  48 (750 -> ??)
--30413-- scheduler: 113,201 jumps (bb entries).
--30413-- scheduler: 1/2,649 major/minor sched events.
--30413--    sanity: 2 cheap, 2 expensive checks.
--30413--    exectx: 769 lists, 33 contexts (avg 0 per list)
--30413--    exectx: 76 searches, 43 full compares (565 per 1000)
--30413--    exectx: 21 cmp2, 174 cmp4, 0 cmpAll
--30413--  errormgr: 24 supplist searches, 784 comparisons during search
--30413--  errormgr: 39 errlist searches, 226 comparisons during search

Please help!
Regards
Halim




reply via email to

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