[sbester@box1 mysql-5.1.30-linux-i686]$ valgrind --tool=memcheck --leak-check=yes -v --show-reachable=yes ./bin/mysqld --basedir=./ --datadir=./data --skip-grant-tables --sync-frm=0 ==16005== Memcheck, a memory error detector. ==16005== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al. ==16005== Using LibVEX rev 1658, a library for dynamic binary translation. ==16005== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP. ==16005== Using valgrind-3.2.1, a dynamic binary instrumentation framework. ==16005== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al. ==16005== --16005-- Command line --16005-- ./bin/mysqld --16005-- --basedir=./ --16005-- --datadir=./data --16005-- --skip-grant-tables --16005-- --sync-frm=0 --16005-- Startup, with flags: --16005-- --tool=memcheck --16005-- --leak-check=yes --16005-- -v --16005-- --show-reachable=yes --16005-- Contents of /proc/version: --16005-- Linux version 2.6.18-1.2798.fc6xen (brewbuilder@hs20-bc2-4.build.redhat.com) (gcc version 4.1.1 20061011 (Red Hat 4.1.1-30)) #1 SMP Mon Oct 16 15:11:19 EDT 2006 --16005-- Arch and hwcaps: X86, x86-sse1-sse2 --16005-- Valgrind library directory: /usr/lib/valgrind --16005-- Reading syms from /lib/ld-2.5.so (0x2C3000) --16005-- Reading syms from /home/sbester/build/mysql-5.1.30-linux-i686/bin/mysqld (0x8048000) --16005-- Reading syms from /usr/lib/valgrind/x86-linux/memcheck (0x38000000) --16005-- object doesn't have a dynamic symbol table --16005-- Reading suppressions file: /usr/lib/valgrind/default.supp --16005-- REDIR: 0x2D80F0 (index) redirected to 0x38027D0F (vgPlain_x86_linux_REDIR_FOR_index) --16005-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_core.so (0x4001000) --16005-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so (0x4003000) ==16005== WARNING: new redirection conflicts with existing -- ignoring it --16005-- new: 0x002D80F0 (index ) R-> 0x040060C0 index --16005-- REDIR: 0x2D8290 (strlen) redirected to 0x4006290 (strlen) --16005-- Reading syms from /lib/libpthread-2.5.so (0x484000) --16005-- Reading syms from /usr/lib/libz.so.1.2.3 (0x12A000) --16005-- object doesn't have a symbol table --16005-- Reading syms from /lib/libdl-2.5.so (0xDD5000) --16005-- Reading syms from /lib/libcrypt-2.5.so (0x50D8000) --16005-- Reading syms from /lib/libnsl-2.5.so (0x2E0000) --16005-- Reading syms from /lib/libm-2.5.so (0x4019000) --16005-- Reading syms from /lib/libc-2.5.so (0x309000) --16005-- REDIR: 0x3764E0 (memset) redirected to 0x4006580 (memset) --16005-- REDIR: 0x3769D0 (memcpy) redirected to 0x4006C60 (memcpy) --16005-- REDIR: 0x375640 (rindex) redirected to 0x4005FA0 (rindex) --16005-- REDIR: 0x375350 (strnlen) redirected to 0x4006240 (strnlen) --16005-- REDIR: 0x376470 (memmove) redirected to 0x40065B0 (memmove) --16005-- REDIR: 0x3709B0 (calloc) redirected to 0x40046A8 (calloc) --16005-- REDIR: 0x370CB0 (malloc) redirected to 0x400537B (malloc) --16005-- Reading syms from /lib/libgcc_s-4.1.1-20061011.so.1 (0x4ECE000) --16005-- object doesn't have a symbol table --16005-- REDIR: 0x3752A0 (strlen) redirected to 0x4006270 (strlen) --16005-- REDIR: 0x375490 (strncmp) redirected to 0x40062D0 (strncmp) --16005-- REDIR: 0x374DB0 (strcpy) redirected to 0x40069F0 (strcpy) --16005-- REDIR: 0x3724C0 (free) redirected to 0x4004F95 (free) --16005-- REDIR: 0x374D40 (strcmp) redirected to 0x4006340 (strcmp) --16005-- REDIR: 0x374BD0 (index) redirected to 0x4006090 (index) --16005-- REDIR: 0x3766D0 (stpcpy) redirected to 0x4006910 (stpcpy) --16005-- REDIR: 0x377280 (rawmemchr) redirected to 0x4006640 (rawmemchr) --16005-- REDIR: 0x374A20 (strcat) redirected to 0x4006660 (strcat) 081003 11:16:46 InnoDB: Started; log sequence number 0 46409 --16005-- REDIR: 0x375FE0 (memchr) redirected to 0x4006460 (memchr) --16005-- REDIR: 0x377350 (strchrnul) redirected to 0x4006610 (strchrnul) --16005-- Reading syms from /lib/libnss_files-2.5.so (0x4E52000) 081003 11:16:47 [Note] ./bin/mysqld: ready for connections. Version: '5.1.30-debug' socket: '/tmp/mysql.sock' port: 3306 yes --16005-- REDIR: 0x3726B0 (realloc) redirected to 0x400542A (realloc) --16005-- Reading syms from /lib/libnss_dns-2.5.so (0x400E000) --16005-- Reading syms from /lib/libresolv-2.5.so (0x4FDA000) ==16005== Thread 12: ==16005== Invalid read of size 4 ==16005== at 0x83A56C8: Query_cache::invalidate(THD*, TABLE_LIST*, char) (sql_cache.cc:2526) ==16005== by 0x82C51DA: mysql_insert(THD*, TABLE_LIST*, List&, List >&, List&, List&, enum_duplicates, bool) (sql_insert.cc:833) ==16005== by 0x823B5DA: mysql_execute_command(THD*) (sql_parse.cc:3018) ==16005== by 0x823FBC3: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5723) ==16005== by 0x8240284: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1152) ==16005== by 0x8241770: do_command(THD*) (sql_parse.cc:809) ==16005== by 0x822F947: handle_one_connection (sql_connect.cc:1115) ==16005== by 0x4893DA: start_thread (in /lib/libpthread-2.5.so) ==16005== by 0x3D606D: clone (in /lib/libc-2.5.so) ==16005== Address 0x4089D98 is 344 bytes inside a block of size 996 free'd ==16005== at 0x400501A: free (vg_replace_malloc.c:233) ==16005== by 0x858A9D6: _myfree (safemalloc.c:314) ==16005== by 0x85897EC: free_root (my_alloc.c:349) ==16005== by 0x8288B54: free_table_share(st_table_share*) (table.cc:431) ==16005== by 0x82758C9: table_def_free_entry(st_table_share*) (sql_base.cc:271) ==16005== by 0x8594F37: my_hash_delete (hash.c:530) ==16005== by 0x8277045: release_table_share(st_table_share*, release_type) (sql_base.cc:578) ==16005== by 0x8288D84: closefrm(st_table*, bool) (table.cc:1981) ==16005== by 0x827D4EE: intern_close_table(st_table*) (sql_base.cc:771) ==16005== by 0x827D593: free_cache_entry(st_table*) (sql_base.cc:793) ==16005== by 0x8594F37: my_hash_delete (hash.c:530) ==16005== by 0x827749E: close_thread_table(THD*, st_table**) (sql_base.cc:1357) ==16005== ==16005== Invalid read of size 4 ==16005== at 0x83A56D2: Query_cache::invalidate(THD*, TABLE_LIST*, char) (sql_cache.cc:2526) ==16005== by 0x82C51DA: mysql_insert(THD*, TABLE_LIST*, List&, List >&, List&, List&, enum_duplicates, bool) (sql_insert.cc:833) ==16005== by 0x823B5DA: mysql_execute_command(THD*) (sql_parse.cc:3018) ==16005== by 0x823FBC3: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5723) ==16005== by 0x8240284: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1152) ==16005== by 0x8241770: do_command(THD*) (sql_parse.cc:809) ==16005== by 0x822F947: handle_one_connection (sql_connect.cc:1115) ==16005== by 0x4893DA: start_thread (in /lib/libpthread-2.5.so) ==16005== by 0x3D606D: clone (in /lib/libc-2.5.so) ==16005== Address 0x4089D94 is 340 bytes inside a block of size 996 free'd ==16005== at 0x400501A: free (vg_replace_malloc.c:233) ==16005== by 0x858A9D6: _myfree (safemalloc.c:314) ==16005== by 0x85897EC: free_root (my_alloc.c:349) ==16005== by 0x8288B54: free_table_share(st_table_share*) (table.cc:431) ==16005== by 0x82758C9: table_def_free_entry(st_table_share*) (sql_base.cc:271) ==16005== by 0x8594F37: my_hash_delete (hash.c:530) ==16005== by 0x8277045: release_table_share(st_table_share*, release_type) (sql_base.cc:578) ==16005== by 0x8288D84: closefrm(st_table*, bool) (table.cc:1981) ==16005== by 0x827D4EE: intern_close_table(st_table*) (sql_base.cc:771) ==16005== by 0x827D593: free_cache_entry(st_table*) (sql_base.cc:793) ==16005== by 0x8594F37: my_hash_delete (hash.c:530) ==16005== by 0x827749E: close_thread_table(THD*, st_table**) (sql_base.cc:1357) 081003 11:20:28 [Note] ./bin/mysqld: Normal shutdown 081003 11:20:28 InnoDB: Starting shutdown... 081003 11:20:30 InnoDB: Shutdown completed; log sequence number 0 46409 081003 11:20:30 [Note] ./bin/mysqld: Shutdown complete --16005-- Discarding syms at 0x4E52000-0x4E5D000 in /lib/libnss_files-2.5.so due to munmap() --16005-- Discarding syms at 0x400E000-0x4014000 in /lib/libnss_dns-2.5.so due to munmap() --16005-- Discarding syms at 0x4FDA000-0x4FED000 in /lib/libresolv-2.5.so due to munmap() ==16005== ==16005== ERROR SUMMARY: 4 errors from 2 contexts (suppressed: 27 from 1) ==16005== ==16005== 2 errors in context 1 of 2: ==16005== Invalid read of size 4 ==16005== at 0x83A56D2: Query_cache::invalidate(THD*, TABLE_LIST*, char) (sql_cache.cc:2526) ==16005== by 0x82C51DA: mysql_insert(THD*, TABLE_LIST*, List&, List >&, List&, List&, enum_duplicates, bool) (sql_insert.cc:833) ==16005== by 0x823B5DA: mysql_execute_command(THD*) (sql_parse.cc:3018) ==16005== by 0x823FBC3: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5723) ==16005== by 0x8240284: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1152) ==16005== by 0x8241770: do_command(THD*) (sql_parse.cc:809) ==16005== by 0x822F947: handle_one_connection (sql_connect.cc:1115) ==16005== by 0x4893DA: start_thread (in /lib/libpthread-2.5.so) ==16005== by 0x3D606D: clone (in /lib/libc-2.5.so) ==16005== Address 0x4089D94 is 340 bytes inside a block of size 996 free'd ==16005== at 0x400501A: free (vg_replace_malloc.c:233) ==16005== by 0x858A9D6: _myfree (safemalloc.c:314) ==16005== by 0x85897EC: free_root (my_alloc.c:349) ==16005== by 0x8288B54: free_table_share(st_table_share*) (table.cc:431) ==16005== by 0x82758C9: table_def_free_entry(st_table_share*) (sql_base.cc:271) ==16005== by 0x8594F37: my_hash_delete (hash.c:530) ==16005== by 0x8277045: release_table_share(st_table_share*, release_type) (sql_base.cc:578) ==16005== by 0x8288D84: closefrm(st_table*, bool) (table.cc:1981) ==16005== by 0x827D4EE: intern_close_table(st_table*) (sql_base.cc:771) ==16005== by 0x827D593: free_cache_entry(st_table*) (sql_base.cc:793) ==16005== by 0x8594F37: my_hash_delete (hash.c:530) ==16005== by 0x827749E: close_thread_table(THD*, st_table**) (sql_base.cc:1357) ==16005== ==16005== 2 errors in context 2 of 2: ==16005== Invalid read of size 4 ==16005== at 0x83A56C8: Query_cache::invalidate(THD*, TABLE_LIST*, char) (sql_cache.cc:2526) ==16005== by 0x82C51DA: mysql_insert(THD*, TABLE_LIST*, List&, List >&, List&, List&, enum_duplicates, bool) (sql_insert.cc:833) ==16005== by 0x823B5DA: mysql_execute_command(THD*) (sql_parse.cc:3018) ==16005== by 0x823FBC3: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5723) ==16005== by 0x8240284: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1152) ==16005== by 0x8241770: do_command(THD*) (sql_parse.cc:809) ==16005== by 0x822F947: handle_one_connection (sql_connect.cc:1115) ==16005== by 0x4893DA: start_thread (in /lib/libpthread-2.5.so) ==16005== by 0x3D606D: clone (in /lib/libc-2.5.so) ==16005== Address 0x4089D98 is 344 bytes inside a block of size 996 free'd ==16005== at 0x400501A: free (vg_replace_malloc.c:233) ==16005== by 0x858A9D6: _myfree (safemalloc.c:314) ==16005== by 0x85897EC: free_root (my_alloc.c:349) ==16005== by 0x8288B54: free_table_share(st_table_share*) (table.cc:431) ==16005== by 0x82758C9: table_def_free_entry(st_table_share*) (sql_base.cc:271) ==16005== by 0x8594F37: my_hash_delete (hash.c:530) ==16005== by 0x8277045: release_table_share(st_table_share*, release_type) (sql_base.cc:578) ==16005== by 0x8288D84: closefrm(st_table*, bool) (table.cc:1981) ==16005== by 0x827D4EE: intern_close_table(st_table*) (sql_base.cc:771) ==16005== by 0x827D593: free_cache_entry(st_table*) (sql_base.cc:793) ==16005== by 0x8594F37: my_hash_delete (hash.c:530) ==16005== by 0x827749E: close_thread_table(THD*, st_table**) (sql_base.cc:1357) --16005-- --16005-- supp: 27 Fedora-Core-6-hack3-ld25 ==16005== ==16005== IN SUMMARY: 4 errors from 2 contexts (suppressed: 27 from 1) ==16005== ==16005== malloc/free: in use at exit: 2,128 bytes in 14 blocks. ==16005== malloc/free: 98,998 allocs, 98,984 frees, 550,366,955 bytes allocated. ==16005== ==16005== searching for pointers to 14 not-freed blocks. ==16005== checked 84,746,420 bytes. ==16005== ==16005== Thread 1: ==16005== ==16005== 19 bytes in 1 blocks are still reachable in loss record 1 of 6 ==16005== at 0x4005400: malloc (vg_replace_malloc.c:149) ==16005== by 0x2CD7E4: _dl_new_object (in /lib/ld-2.5.so) ==16005== by 0x2C90E0: _dl_map_object_from_fd (in /lib/ld-2.5.so) ==16005== by 0x2CB403: _dl_map_object (in /lib/ld-2.5.so) ==16005== by 0x2D4668: dl_open_worker (in /lib/ld-2.5.so) ==16005== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16005== by 0x2D4191: _dl_open (in /lib/ld-2.5.so) ==16005== by 0x40B3A1: do_dlopen (in /lib/libc-2.5.so) ==16005== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16005== by 0x40B554: __libc_dlopen_mode (in /lib/libc-2.5.so) ==16005== by 0x491A46: pthread_cancel_init (in /lib/libpthread-2.5.so) ==16005== by 0x491B70: _Unwind_ForcedUnwind (in /lib/libpthread-2.5.so) ==16005== ==16005== ==16005== 19 bytes in 1 blocks are still reachable in loss record 2 of 6 ==16005== at 0x4005400: malloc (vg_replace_malloc.c:149) ==16005== by 0x2CB953: _dl_map_object (in /lib/ld-2.5.so) ==16005== by 0x2D4668: dl_open_worker (in /lib/ld-2.5.so) ==16005== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16005== by 0x2D4191: _dl_open (in /lib/ld-2.5.so) ==16005== by 0x40B3A1: do_dlopen (in /lib/libc-2.5.so) ==16005== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16005== by 0x40B554: __libc_dlopen_mode (in /lib/libc-2.5.so) ==16005== by 0x491A46: pthread_cancel_init (in /lib/libpthread-2.5.so) ==16005== by 0x491B70: _Unwind_ForcedUnwind (in /lib/libpthread-2.5.so) ==16005== by 0x48F640: __pthread_unwind (in /lib/libpthread-2.5.so) ==16005== by 0x48A31F: pthread_exit (in /lib/libpthread-2.5.so) ==16005== ==16005== ==16005== 28 bytes in 1 blocks are still reachable in loss record 3 of 6 ==16005== at 0x4005400: malloc (vg_replace_malloc.c:149) ==16005== by 0x2CFA38: _dl_map_object_deps (in /lib/ld-2.5.so) ==16005== by 0x2D46C4: dl_open_worker (in /lib/ld-2.5.so) ==16005== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16005== by 0x2D4191: _dl_open (in /lib/ld-2.5.so) ==16005== by 0x40B3A1: do_dlopen (in /lib/libc-2.5.so) ==16005== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16005== by 0x40B554: __libc_dlopen_mode (in /lib/libc-2.5.so) ==16005== by 0x491A46: pthread_cancel_init (in /lib/libpthread-2.5.so) ==16005== by 0x491B70: _Unwind_ForcedUnwind (in /lib/libpthread-2.5.so) ==16005== by 0x48F640: __pthread_unwind (in /lib/libpthread-2.5.so) ==16005== by 0x48A31F: pthread_exit (in /lib/libpthread-2.5.so) ==16005== ==16005== ==16005== 224 bytes in 1 blocks are still reachable in loss record 4 of 6 ==16005== at 0x400473F: calloc (vg_replace_malloc.c:279) ==16005== by 0x2D2353: _dl_check_map_versions (in /lib/ld-2.5.so) ==16005== by 0x2D4980: dl_open_worker (in /lib/ld-2.5.so) ==16005== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16005== by 0x2D4191: _dl_open (in /lib/ld-2.5.so) ==16005== by 0x40B3A1: do_dlopen (in /lib/libc-2.5.so) ==16005== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16005== by 0x40B554: __libc_dlopen_mode (in /lib/libc-2.5.so) ==16005== by 0x491A46: pthread_cancel_init (in /lib/libpthread-2.5.so) ==16005== by 0x491B70: _Unwind_ForcedUnwind (in /lib/libpthread-2.5.so) ==16005== by 0x48F640: __pthread_unwind (in /lib/libpthread-2.5.so) ==16005== by 0x48A31F: pthread_exit (in /lib/libpthread-2.5.so) ==16005== ==16005== ==16005== 614 bytes in 1 blocks are still reachable in loss record 5 of 6 ==16005== at 0x400473F: calloc (vg_replace_malloc.c:279) ==16005== by 0x2CD57A: _dl_new_object (in /lib/ld-2.5.so) ==16005== by 0x2C90E0: _dl_map_object_from_fd (in /lib/ld-2.5.so) ==16005== by 0x2CB403: _dl_map_object (in /lib/ld-2.5.so) ==16005== by 0x2D4668: dl_open_worker (in /lib/ld-2.5.so) ==16005== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16005== by 0x2D4191: _dl_open (in /lib/ld-2.5.so) ==16005== by 0x40B3A1: do_dlopen (in /lib/libc-2.5.so) ==16005== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16005== by 0x40B554: __libc_dlopen_mode (in /lib/libc-2.5.so) ==16005== by 0x491A46: pthread_cancel_init (in /lib/libpthread-2.5.so) ==16005== by 0x491B70: _Unwind_ForcedUnwind (in /lib/libpthread-2.5.so) ==16005== ==16005== ==16005== 1,224 bytes in 9 blocks are possibly lost in loss record 6 of 6 ==16005== at 0x400473F: calloc (vg_replace_malloc.c:279) ==16005== by 0x2D3AA9: _dl_allocate_tls (in /lib/ld-2.5.so) ==16005== by 0x489AC8: pthread_create@@GLIBC_2.1 (in /lib/libpthread-2.5.so) ==16005== by 0x85A9D79: my_thread_global_init (my_thr_init.c:113) ==16005== by 0x857AC84: my_init (my_init.c:92) ==16005== by 0x822AAF7: main (mysqld.cc:4130) ==16005== ==16005== LEAK SUMMARY: ==16005== definitely lost: 0 bytes in 0 blocks. ==16005== possibly lost: 1,224 bytes in 9 blocks. ==16005== still reachable: 904 bytes in 5 blocks. ==16005== suppressed: 0 bytes in 0 blocks. --16005-- memcheck: sanity checks: 17706 cheap, 709 expensive --16005-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use --16005-- memcheck: auxmaps: 0 searches, 0 comparisons --16005-- memcheck: SMs: n_issued = 4379 (70064k, 68M) --16005-- memcheck: SMs: n_deissued = 3957 (63312k, 61M) --16005-- memcheck: SMs: max_noaccess = 65535 (1048560k, 1023M) --16005-- memcheck: SMs: max_undefined = 192 (3072k, 3M) --16005-- memcheck: SMs: max_defined = 1465 (23440k, 22M) --16005-- memcheck: SMs: max_non_DSM = 786 (12576k, 12M) --16005-- memcheck: max sec V bit nodes: 781 (39k, 0M) --16005-- memcheck: set_sec_vbits8 calls: 2224 (new: 781, updates: 1443) --16005-- memcheck: max shadow mem size: 12919k, 12M --16005-- translate: fast SP updates identified: 35,986 ( 85.0%) --16005-- translate: generic_known SP updates identified: 5,573 ( 13.1%) --16005-- translate: generic_unknown SP updates identified: 736 ( 1.7%) --16005-- tt/tc: 3,997,052 tt lookups requiring 5,095,299 probes --16005-- tt/tc: 3,997,052 fast-cache updates, 6 flushes --16005-- transtab: new 25,620 (846,427 -> 12,017,524; ratio 141:10) [0 scs] --16005-- transtab: dumped 0 (0 -> ??) --16005-- transtab: discarded 513 (10,071 -> ??) --16005-- scheduler: 1,629,180,153 jumps (bb entries). --16005-- scheduler: 17,706/5,067,839 major/minor sched events. --16005-- sanity: 17707 cheap, 709 expensive checks. --16005-- exectx: 30,011 lists, 1,246 contexts (avg 0 per list) --16005-- exectx: 198,013 searches, 197,308 full compares (996 per 1000) --16005-- exectx: 18 cmp2, 88 cmp4, 0 cmpAll [sbester@box1 mysql-5.1.30-linux-i686]$