memory leak in pthread_exit()

Bug #367937 reported by Andrey
2
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: libc6

Valgrind reports a (reachable) memory leak when pthread_exit() is called.

Steps to Reproduce:

1. g++ -Wall pthread_exit.c -lpthread (see attachment)
2. valgrind --leak-check=full --show-reachable=yes -v ./a.out

Result:
==10272== Memcheck, a memory error detector.
==10272== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==10272== Using LibVEX rev 1804, a library for dynamic binary translation.
==10272== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==10272== Using valgrind-3.3.0-Debian, a dynamic binary instrumentation framework.
==10272== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==10272==
--10272-- Command line
--10272-- ./a.out
--10272-- Startup, with flags:
--10272-- --leak-check=full
--10272-- --show-reachable=yes
--10272-- -v
--10272-- Contents of /proc/version:
--10272-- Linux version 2.6.24-16-generic (buildd@palmer) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #1 SMP Thu Apr 10 13:23:42 UTC 2008
--10272-- Arch and hwcaps: X86, x86-sse1-sse2
--10272-- Page sizes: currently 4096, max supported 4096
--10272-- Valgrind library directory: /usr/lib/valgrind
--10272-- Reading syms from /lib/ld-2.7.so (0x4000000)
--10272-- Reading debug info from /lib/ld-2.7.so...
--10272-- ... CRC mismatch (computed b93a03d2 wanted 46e85b4d)
--10272-- object doesn't have a symbol table
--10272-- Reading syms from /root/workfile/test_server/a.out (0x8048000)
--10272-- Reading syms from /usr/lib/valgrind/x86-linux/memcheck (0x38000000)
--10272-- object doesn't have a dynamic symbol table
--10272-- Reading suppressions file: /usr/lib/valgrind/default.supp
--10272-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_core.so (0x401E000)
--10272-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so (0x4020000)
--10272-- Reading syms from /lib/tls/i686/cmov/libpthread-2.7.so (0x403A000)
--10272-- Reading debug info from /lib/tls/i686/cmov/libpthread-2.7.so...
--10272-- ... CRC mismatch (computed ad1a7762 wanted effcce0a)
--10272-- Reading syms from /usr/lib/libstdc++.so.6.0.9 (0x4052000)
--10272-- Reading debug info from /usr/lib/libstdc++.so.6.0.9...
--10272-- ... CRC mismatch (computed e7a251ae wanted 89ddaef6)
--10272-- object doesn't have a symbol table
--10272-- Reading syms from /lib/tls/i686/cmov/libm-2.7.so (0x4146000)
--10272-- Reading debug info from /lib/tls/i686/cmov/libm-2.7.so...
--10272-- ... CRC mismatch (computed a35b3de9 wanted 4dd52e16)
--10272-- object doesn't have a symbol table
--10272-- Reading syms from /lib/libgcc_s.so.1 (0x416B000)
--10272-- Reading debug info from /lib/libgcc_s.so.1...
--10272-- ... CRC mismatch (computed d533060a wanted 94d3c196)
--10272-- object doesn't have a symbol table
--10272-- Reading syms from /lib/tls/i686/cmov/libc-2.7.so (0x4176000)
--10272-- Reading debug info from /lib/tls/i686/cmov/libc-2.7.so...
--10272-- ... CRC mismatch (computed 5861e7f6 wanted 741a7509)
--10272-- object doesn't have a symbol table
--10272-- REDIR: 0x41e94b0 (memset) redirected to 0x4023d50 (memset)
--10272-- REDIR: 0x41e99a0 (memcpy) redirected to 0x4024aa0 (memcpy)
--10272-- REDIR: 0x41e8620 (rindex) redirected to 0x4023710 (rindex)
--10272-- REDIR: 0x41e3930 (calloc) redirected to 0x4021b70 (calloc)
--10272-- REDIR: 0x41e3c20 (malloc) redirected to 0x4022a50 (malloc)
--10272-- REDIR: 0x41e8250 (strlen) redirected to 0x40239d0 (strlen)
--10272-- REDIR: 0x41e5460 (free) redirected to 0x40225f0 (free)
==10272==
==10272== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 19 from 1)
--10272--
--10272-- supp: 19 dl-hack3-1
==10272== malloc/free: in use at exit: 28 bytes in 1 blocks.
==10272== malloc/free: 2 allocs, 1 frees, 172 bytes allocated.
==10272==
==10272== searching for pointers to 1 not-freed blocks.
==10272== checked 125,832 bytes.
==10272==
==10272== 28 bytes in 1 blocks are still reachable in loss record 1 of 1
==10272== at 0x4022AB8: malloc (vg_replace_malloc.c:207)
==10272== by 0x400BF5F: (within /lib/ld-2.7.so)
==10272== by 0x40115A3: (within /lib/ld-2.7.so)
==10272== by 0x400D5D5: (within /lib/ld-2.7.so)
==10272== by 0x4010F5D: (within /lib/ld-2.7.so)
==10272== by 0x4284291: (within /lib/tls/i686/cmov/libc-2.7.so)
==10272== by 0x400D5D5: (within /lib/ld-2.7.so)
==10272== by 0x4284454: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.7.so)
==10272== by 0x4048686: pthread_cancel_init (in /lib/tls/i686/cmov/libpthread-2.7.so)
==10272== by 0x40487B0: _Unwind_ForcedUnwind (in /lib/tls/i686/cmov/libpthread-2.7.so)
==10272== by 0x4046210: __pthread_unwind (in /lib/tls/i686/cmov/libpthread-2.7.so)
==10272== by 0x40405EF: pthread_exit (in /lib/tls/i686/cmov/libpthread-2.7.so)
==10272==
==10272== LEAK SUMMARY:
==10272== definitely lost: 0 bytes in 0 blocks.
==10272== possibly lost: 0 bytes in 0 blocks.
==10272== still reachable: 28 bytes in 1 blocks.
==10272== suppressed: 0 bytes in 0 blocks.
--10272-- memcheck: sanity checks: 2 cheap, 2 expensive
--10272-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--10272-- memcheck: auxmaps_L1: 0 searches, 0 cmps, ratio 0:10
--10272-- memcheck: auxmaps_L2: 0 searches, 0 nodes
--10272-- memcheck: SMs: n_issued = 14 (224k, 0M)
--10272-- memcheck: SMs: n_deissued = 0 (0k, 0M)
--10272-- memcheck: SMs: max_noaccess = 65535 (1048560k, 1023M)
--10272-- memcheck: SMs: max_undefined = 0 (0k, 0M)
--10272-- memcheck: SMs: max_defined = 163 (2608k, 2M)
--10272-- memcheck: SMs: max_non_DSM = 14 (224k, 0M)
--10272-- memcheck: max sec V bit nodes: 0 (0k, 0M)
--10272-- memcheck: set_sec_vbits8 calls: 0 (new: 0, updates: 0)
--10272-- memcheck: max shadow mem size: 528k, 0M
--10272-- translate: fast SP updates identified: 2,806 ( 90.6%)
--10272-- translate: generic_known SP updates identified: 172 ( 5.5%)
--10272-- translate: generic_unknown SP updates identified: 119 ( 3.8%)
--10272-- tt/tc: 5,258 tt lookups requiring 5,371 probes
--10272-- tt/tc: 5,258 fast-cache updates, 2 flushes
--10272-- transtab: new 2,620 (56,178 -> 816,520; ratio 145:10) [0 scs]
--10272-- transtab: dumped 0 (0 -> ??)
--10272-- transtab: discarded 0 (0 -> ??)
--10272-- scheduler: 240,599 jumps (bb entries).
--10272-- scheduler: 2/2,761 major/minor sched events.
--10272-- sanity: 3 cheap, 2 expensive checks.
--10272-- exectx: 769 lists, 9 contexts (avg 0 per list)
--10272-- exectx: 22 searches, 13 full compares (590 per 1000)
--10272-- exectx: 0 cmp2, 42 cmp4, 0 cmpAll
--10272-- errormgr: 7 supplist searches, 145 comparisons during search
--10272-- errormgr: 19 errlist searches, 42 comparisons during search

Revision history for this message
Andrey (fant) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.