original testcase file: ------------------------ i|1|set global concurrent_insert=2| i|1|set global max_allowed_packet=1024*1024*1024| i|1|drop table if exists t1| i|1|create table t1(id longblob,key(id(1024)))engine=myisam| #n|1|kill query| #n|1|charset| n|10|insert into t1 set id='?'|blob n|10|insert delayed into t1 set id='?'|blob #n|1|repair table t1| n|1|truncate t1| #n|1|alter table t1 engine=blackhole| #n|1|alter table t1 engine=myisam| n|1|flush tables| n|1|checksum table t1| gypsy --queryfile=fix.sql --generate-testcase=0 --threads=5 --log=4 --duration=600 --shuffle-queries=1 --host=192.168.250.4 completed uedited valgrind output: ------------------------------------ [sbester@box1 mysql-5.1.26-rc-linux-i686-glibc23]$ valgrind --tool=memcheck --leak-check=yes -v --show-reachable=yes ./bin/mysqld --basedir=./ --datadir=/home/sbester/mysql/5.0/mysql-enterprise-gpl-5.0.66a-linux-i686-glibc23/data --skip-grant-tables --skip-name-resolve ==16247== Memcheck, a memory error detector. ==16247== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al. ==16247== Using LibVEX rev 1658, a library for dynamic binary translation. ==16247== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP. ==16247== Using valgrind-3.2.1, a dynamic binary instrumentation framework. ==16247== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al. ==16247== --16247-- Command line --16247-- ./bin/mysqld --16247-- --basedir=./ --16247-- --datadir=/home/sbester/mysql/5.0/mysql-enterprise-gpl-5.0.66a-linux-i686-glibc23/data --16247-- --skip-grant-tables --16247-- --skip-name-resolve --16247-- Startup, with flags: --16247-- --tool=memcheck --16247-- --leak-check=yes --16247-- -v --16247-- --show-reachable=yes --16247-- Contents of /proc/version: --16247-- 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 --16247-- Arch and hwcaps: X86, x86-sse1-sse2 --16247-- Valgrind library directory: /usr/lib/valgrind --16247-- Reading syms from /lib/ld-2.5.so (0x2C3000) --16247-- Reading syms from /home/sbester/mysql/5.1/mysql-5.1.26-rc-linux-i686-glibc23/bin/mysqld (0x8048000) --16247-- Reading syms from /usr/lib/valgrind/x86-linux/memcheck (0x38000000) --16247-- object doesn't have a dynamic symbol table --16247-- Reading suppressions file: /usr/lib/valgrind/default.supp --16247-- REDIR: 0x2D80F0 (index) redirected to 0x38027D0F (vgPlain_x86_linux_REDIR_FOR_index) --16247-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_core.so (0x4001000) --16247-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so (0x4003000) ==16247== WARNING: new redirection conflicts with existing -- ignoring it --16247-- new: 0x002D80F0 (index ) R-> 0x040060C0 index --16247-- REDIR: 0x2D8290 (strlen) redirected to 0x4006290 (strlen) --16247-- Reading syms from /lib/libpthread-2.5.so (0x484000) --16247-- Reading syms from /lib/libdl-2.5.so (0xDD5000) --16247-- Reading syms from /lib/libcrypt-2.5.so (0x50D8000) --16247-- Reading syms from /lib/libnsl-2.5.so (0x2E0000) --16247-- Reading syms from /lib/libm-2.5.so (0x4019000) --16247-- Reading syms from /lib/libc-2.5.so (0x309000) --16247-- REDIR: 0x3764E0 (memset) redirected to 0x4006580 (memset) --16247-- REDIR: 0x3769D0 (memcpy) redirected to 0x4006C60 (memcpy) --16247-- REDIR: 0x375640 (rindex) redirected to 0x4005FA0 (rindex) --16247-- REDIR: 0x375350 (strnlen) redirected to 0x4006240 (strnlen) --16247-- REDIR: 0x376470 (memmove) redirected to 0x40065B0 (memmove) --16247-- REDIR: 0x3709B0 (calloc) redirected to 0x40046A8 (calloc) --16247-- REDIR: 0x370CB0 (malloc) redirected to 0x400537B (malloc) --16247-- REDIR: 0x375FE0 (memchr) redirected to 0x4006460 (memchr) --16247-- REDIR: 0x3724C0 (free) redirected to 0x4004F95 (free) --16247-- Reading syms from /lib/libgcc_s-4.1.1-20061011.so.1 (0x4ECE000) --16247-- object doesn't have a symbol table --16247-- REDIR: 0x3752A0 (strlen) redirected to 0x4006270 (strlen) --16247-- REDIR: 0x375490 (strncmp) redirected to 0x40062D0 (strncmp) --16247-- REDIR: 0x3766D0 (stpcpy) redirected to 0x4006910 (stpcpy) --16247-- REDIR: 0x374DB0 (strcpy) redirected to 0x40069F0 (strcpy) --16247-- REDIR: 0x374D40 (strcmp) redirected to 0x4006340 (strcmp) --16247-- REDIR: 0x374BD0 (index) redirected to 0x4006090 (index) --16247-- REDIR: 0x377280 (rawmemchr) redirected to 0x4006640 (rawmemchr) --16247-- REDIR: 0x3726B0 (realloc) redirected to 0x400542A (realloc) 080731 18:21:15 InnoDB: Started; log sequence number 0 47414407 --16247-- memcheck GC: 1024 nodes, 1024 survivors (100.0%) --16247-- memcheck GC: increase table size to 2048 --16247-- REDIR: 0x377350 (strchrnul) redirected to 0x4006610 (strchrnul) --16247-- Reading syms from /lib/libnss_files-2.5.so (0x4E52000) 080731 18:21:16 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist --16247-- REDIR: 0x374A20 (strcat) redirected to 0x4006660 (strcat) 080731 18:21:16 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50066, now running 50126. Please use mysql_upgrade to fix this error. 080731 18:21:16 [ERROR] mysql.user has no `Event_priv` column at position 29 080731 18:21:16 [ERROR] Cannot open mysql.event 080731 18:21:16 [ERROR] Event Scheduler: An error occurred when initializing system tables. 080731 18:21:16 [Note] ./bin/mysqld: ready for connections. Version: '5.1.26-rc' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL) ==16247== Thread 12: ==16247== Syscall param pwrite64(buf) points to uninitialised byte(s) ==16247== at 0x490AA6: pwrite64 (in /lib/libpthread-2.5.so) ==16247== by 0x8408AB4: my_pwrite (my_pread.c:144) ==16247== by 0x840B658: flush_cached_blocks (mf_keycache.c:3464) ==16247== by 0x840AD5D: flush_key_blocks_int (mf_keycache.c:3758) ==16247== by 0x840A099: flush_key_blocks (mf_keycache.c:4015) ==16247== by 0x83E10E9: mi_lock_database (mi_locking.c:77) ==16247== by 0x828D193: handler::ha_external_lock(THD*, int) (handler.cc:4492) ==16247== by 0x81C7584: unlock_external(THD*, st_table**, unsigned) (lock.cc:786) ==16247== by 0x81C639B: mysql_unlock_tables(THD*, st_mysql_lock*) (lock.cc:391) ==16247== by 0x8235E0B: handle_delayed_insert (sql_insert.cc:2439) ==16247== by 0x4893DA: start_thread (in /lib/libpthread-2.5.so) ==16247== by 0x3D606D: clone (in /lib/libc-2.5.so) ==16247== Address 0x5107FEA is 8,130 bytes inside a block of size 7,421,952 alloc'd ==16247== at 0x4005400: malloc (vg_replace_malloc.c:149) ==16247== by 0x840DEB9: my_malloc (my_malloc.c:34) ==16247== by 0x8408E6E: init_key_cache (mf_keycache.c:433) ==16247== by 0x828C66E: ha_init_key_cache (handler.cc:3596) ==16247== by 0x81EA3DE: process_key_caches(int (*)(char const*, st_key_cache*)) (set_var.cc:3953) ==16247== by 0x81CDEF7: init_server_components() (mysqld.cc:3824) ==16247== by 0x81CA751: main (mysqld.cc:4268) 080731 18:25:27 [ERROR] Delayed insert thread couldn't get requested lock for table t1 080731 18:26:11 [ERROR] Delayed insert thread couldn't get requested lock for table t1 080731 18:28:00 [ERROR] Delayed insert thread couldn't get requested lock for table t1 080731 18:32:46 [Note] ./bin/mysqld: Normal shutdown 080731 18:32:46 InnoDB: Starting shutdown... 080731 18:32:47 InnoDB: Shutdown completed; log sequence number 0 47414407 080731 18:32:47 [Note] ./bin/mysqld: Shutdown complete --16247-- Discarding syms at 0x4E52000-0x4E5D000 in /lib/libnss_files-2.5.so due to munmap() ==16247== ==16247== ERROR SUMMARY: 59666 errors from 1 contexts (suppressed: 22 from 1) ==16247== ==16247== 59666 errors in context 1 of 1: ==16247== Syscall param pwrite64(buf) points to uninitialised byte(s) ==16247== at 0x490AA6: pwrite64 (in /lib/libpthread-2.5.so) ==16247== by 0x8408AB4: my_pwrite (my_pread.c:144) ==16247== by 0x840B658: flush_cached_blocks (mf_keycache.c:3464) ==16247== by 0x840AD5D: flush_key_blocks_int (mf_keycache.c:3758) ==16247== by 0x840A099: flush_key_blocks (mf_keycache.c:4015) ==16247== by 0x83E10E9: mi_lock_database (mi_locking.c:77) ==16247== by 0x828D193: handler::ha_external_lock(THD*, int) (handler.cc:4492) ==16247== by 0x81C7584: unlock_external(THD*, st_table**, unsigned) (lock.cc:786) ==16247== by 0x81C639B: mysql_unlock_tables(THD*, st_mysql_lock*) (lock.cc:391) ==16247== by 0x8235E0B: handle_delayed_insert (sql_insert.cc:2439) ==16247== by 0x4893DA: start_thread (in /lib/libpthread-2.5.so) ==16247== by 0x3D606D: clone (in /lib/libc-2.5.so) ==16247== Address 0x5107FEA is 8,130 bytes inside a block of size 7,421,952 alloc'd ==16247== at 0x4005400: malloc (vg_replace_malloc.c:149) ==16247== by 0x840DEB9: my_malloc (my_malloc.c:34) ==16247== by 0x8408E6E: init_key_cache (mf_keycache.c:433) ==16247== by 0x828C66E: ha_init_key_cache (handler.cc:3596) ==16247== by 0x81EA3DE: process_key_caches(int (*)(char const*, st_key_cache*)) (set_var.cc:3953) ==16247== by 0x81CDEF7: init_server_components() (mysqld.cc:3824) ==16247== by 0x81CA751: main (mysqld.cc:4268) --16247-- --16247-- supp: 22 Fedora-Core-6-hack3-ld25 ==16247== ==16247== IN SUMMARY: 59666 errors from 1 contexts (suppressed: 22 from 1) ==16247== ==16247== malloc/free: in use at exit: 45,584 bytes in 34 blocks. ==16247== malloc/free: 831,117 allocs, 831,083 frees, 1,820,501,597 bytes allocated. ==16247== ==16247== searching for pointers to 34 not-freed blocks. ==16247== checked 85,714,948 bytes. ==16247== ==16247== Thread 1: ==16247== ==16247== 19 bytes in 1 blocks are still reachable in loss record 1 of 8 ==16247== at 0x4005400: malloc (vg_replace_malloc.c:149) ==16247== by 0x2CD7E4: _dl_new_object (in /lib/ld-2.5.so) ==16247== by 0x2C90E0: _dl_map_object_from_fd (in /lib/ld-2.5.so) ==16247== by 0x2CB403: _dl_map_object (in /lib/ld-2.5.so) ==16247== by 0x2D4668: dl_open_worker (in /lib/ld-2.5.so) ==16247== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16247== by 0x2D4191: _dl_open (in /lib/ld-2.5.so) ==16247== by 0x40B3A1: do_dlopen (in /lib/libc-2.5.so) ==16247== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16247== by 0x40B554: __libc_dlopen_mode (in /lib/libc-2.5.so) ==16247== by 0x491A46: pthread_cancel_init (in /lib/libpthread-2.5.so) ==16247== by 0x491B70: _Unwind_ForcedUnwind (in /lib/libpthread-2.5.so) ==16247== ==16247== ==16247== 19 bytes in 1 blocks are still reachable in loss record 2 of 8 ==16247== at 0x4005400: malloc (vg_replace_malloc.c:149) ==16247== by 0x2CB953: _dl_map_object (in /lib/ld-2.5.so) ==16247== by 0x2D4668: dl_open_worker (in /lib/ld-2.5.so) ==16247== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16247== by 0x2D4191: _dl_open (in /lib/ld-2.5.so) ==16247== by 0x40B3A1: do_dlopen (in /lib/libc-2.5.so) ==16247== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16247== by 0x40B554: __libc_dlopen_mode (in /lib/libc-2.5.so) ==16247== by 0x491A46: pthread_cancel_init (in /lib/libpthread-2.5.so) ==16247== by 0x491B70: _Unwind_ForcedUnwind (in /lib/libpthread-2.5.so) ==16247== by 0x48F640: __pthread_unwind (in /lib/libpthread-2.5.so) ==16247== by 0x48A31F: pthread_exit (in /lib/libpthread-2.5.so) ==16247== ==16247== ==16247== 28 bytes in 1 blocks are still reachable in loss record 3 of 8 ==16247== at 0x4005400: malloc (vg_replace_malloc.c:149) ==16247== by 0x2CFA38: _dl_map_object_deps (in /lib/ld-2.5.so) ==16247== by 0x2D46C4: dl_open_worker (in /lib/ld-2.5.so) ==16247== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16247== by 0x2D4191: _dl_open (in /lib/ld-2.5.so) ==16247== by 0x40B3A1: do_dlopen (in /lib/libc-2.5.so) ==16247== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16247== by 0x40B554: __libc_dlopen_mode (in /lib/libc-2.5.so) ==16247== by 0x491A46: pthread_cancel_init (in /lib/libpthread-2.5.so) ==16247== by 0x491B70: _Unwind_ForcedUnwind (in /lib/libpthread-2.5.so) ==16247== by 0x48F640: __pthread_unwind (in /lib/libpthread-2.5.so) ==16247== by 0x48A31F: pthread_exit (in /lib/libpthread-2.5.so) ==16247== ==16247== ==16247== 224 bytes in 1 blocks are still reachable in loss record 4 of 8 ==16247== at 0x400473F: calloc (vg_replace_malloc.c:279) ==16247== by 0x2D2353: _dl_check_map_versions (in /lib/ld-2.5.so) ==16247== by 0x2D4980: dl_open_worker (in /lib/ld-2.5.so) ==16247== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16247== by 0x2D4191: _dl_open (in /lib/ld-2.5.so) ==16247== by 0x40B3A1: do_dlopen (in /lib/libc-2.5.so) ==16247== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16247== by 0x40B554: __libc_dlopen_mode (in /lib/libc-2.5.so) ==16247== by 0x491A46: pthread_cancel_init (in /lib/libpthread-2.5.so) ==16247== by 0x491B70: _Unwind_ForcedUnwind (in /lib/libpthread-2.5.so) ==16247== by 0x48F640: __pthread_unwind (in /lib/libpthread-2.5.so) ==16247== by 0x48A31F: pthread_exit (in /lib/libpthread-2.5.so) ==16247== ==16247== ==16247== 614 bytes in 1 blocks are still reachable in loss record 5 of 8 ==16247== at 0x400473F: calloc (vg_replace_malloc.c:279) ==16247== by 0x2CD57A: _dl_new_object (in /lib/ld-2.5.so) ==16247== by 0x2C90E0: _dl_map_object_from_fd (in /lib/ld-2.5.so) ==16247== by 0x2CB403: _dl_map_object (in /lib/ld-2.5.so) ==16247== by 0x2D4668: dl_open_worker (in /lib/ld-2.5.so) ==16247== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16247== by 0x2D4191: _dl_open (in /lib/ld-2.5.so) ==16247== by 0x40B3A1: do_dlopen (in /lib/libc-2.5.so) ==16247== by 0x2D0C05: _dl_catch_error (in /lib/ld-2.5.so) ==16247== by 0x40B554: __libc_dlopen_mode (in /lib/libc-2.5.so) ==16247== by 0x491A46: pthread_cancel_init (in /lib/libpthread-2.5.so) ==16247== by 0x491B70: _Unwind_ForcedUnwind (in /lib/libpthread-2.5.so) ==16247== ==16247== ==16247== 1,224 bytes in 9 blocks are possibly lost in loss record 6 of 8 ==16247== at 0x400473F: calloc (vg_replace_malloc.c:279) ==16247== by 0x2D3AA9: _dl_allocate_tls (in /lib/ld-2.5.so) ==16247== by 0x489AC8: pthread_create@@GLIBC_2.1 (in /lib/libpthread-2.5.so) ==16247== by 0x841F0EE: my_thread_global_init (my_thr_init.c:113) ==16247== by 0x8407CAF: my_init (my_init.c:92) ==16247== by 0x81CA591: main (mysqld.cc:4133) ==16247== ==16247== ==16247== 4,088 bytes in 1 blocks are possibly lost in loss record 7 of 8 ==16247== at 0x4005400: malloc (vg_replace_malloc.c:149) ==16247== by 0x840DEB9: my_malloc (my_malloc.c:34) ==16247== by 0x81C79D1: String::real_alloc(unsigned) (sql_string.cc:51) ==16247== by 0x81B1309: Field_blob::store(char const*, unsigned, charset_info_st*) (sql_string.h:202) ==16247== by 0x813DDAB: Item::save_str_value_in_field(Field*, String*) (sql_string.h:99) ==16247== by 0x820AB12: fill_record(THD*, List&, List&, bool) (sql_base.cc:7944) ==16247== by 0x8208C1F: fill_record_n_invoke_before_triggers(THD*, List&, List&, bool, Table_triggers_list*, trg_event_type) (sql_base.cc:7987) ==16247== by 0x8233F19: mysql_insert(THD*, TABLE_LIST*, List&, List >&, List&, List&, enum_duplicates, bool) (sql_insert.cc:747) ==16247== by 0x81D724D: mysql_execute_command(THD*) (sql_parse.cc:2953) ==16247== by 0x81DB910: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5645) ==16247== by 0x81D424D: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1137) ==16247== by 0x81D3DD2: do_command(THD*) (sql_parse.cc:794) ==16247== ==16247== ==16247== 39,368 bytes in 19 blocks are definitely lost in loss record 8 of 8 ==16247== at 0x4005400: malloc (vg_replace_malloc.c:149) ==16247== by 0x840DEB9: my_malloc (my_malloc.c:34) ==16247== by 0x81C79D1: String::real_alloc(unsigned) (sql_string.cc:51) ==16247== by 0x81B1309: Field_blob::store(char const*, unsigned, charset_info_st*) (sql_string.h:202) ==16247== by 0x813DDAB: Item::save_str_value_in_field(Field*, String*) (sql_string.h:99) ==16247== by 0x820AB12: fill_record(THD*, List&, List&, bool) (sql_base.cc:7944) ==16247== by 0x8208C1F: fill_record_n_invoke_before_triggers(THD*, List&, List&, bool, Table_triggers_list*, trg_event_type) (sql_base.cc:7987) ==16247== by 0x8233F19: mysql_insert(THD*, TABLE_LIST*, List&, List >&, List&, List&, enum_duplicates, bool) (sql_insert.cc:747) ==16247== by 0x81D724D: mysql_execute_command(THD*) (sql_parse.cc:2953) ==16247== by 0x81DB910: mysql_parse(THD*, char const*, unsigned, char const**) (sql_parse.cc:5645) ==16247== by 0x81D424D: dispatch_command(enum_server_command, THD*, char*, unsigned) (sql_parse.cc:1137) ==16247== by 0x81D3DD2: do_command(THD*) (sql_parse.cc:794) ==16247== ==16247== LEAK SUMMARY: ==16247== definitely lost: 39,368 bytes in 19 blocks. ==16247== possibly lost: 5,312 bytes in 10 blocks. ==16247== still reachable: 904 bytes in 5 blocks. ==16247== suppressed: 0 bytes in 0 blocks. --16247-- memcheck: sanity checks: 34184 cheap, 1368 expensive --16247-- memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use --16247-- memcheck: auxmaps: 0 searches, 0 comparisons --16247-- memcheck: SMs: n_issued = 12148 (194368k, 189M) --16247-- memcheck: SMs: n_deissued = 11753 (188048k, 183M) --16247-- memcheck: SMs: max_noaccess = 65535 (1048560k, 1023M) --16247-- memcheck: SMs: max_undefined = 515 (8240k, 8M) --16247-- memcheck: SMs: max_defined = 1445 (23120k, 22M) --16247-- memcheck: SMs: max_non_DSM = 636 (10176k, 9M) --16247-- memcheck: max sec V bit nodes: 1224 (62k, 0M) --16247-- memcheck: set_sec_vbits8 calls: 3149 (new: 1224, updates: 1925) --16247-- memcheck: max shadow mem size: 10542k, 10M --16247-- translate: fast SP updates identified: 51,942 ( 91.1%) --16247-- translate: generic_known SP updates identified: 1,778 ( 3.1%) --16247-- translate: generic_unknown SP updates identified: 3,269 ( 5.7%) --16247-- tt/tc: 10,184,572 tt lookups requiring 12,499,844 probes --16247-- tt/tc: 10,184,572 fast-cache updates, 4 flushes --16247-- transtab: new 23,491 (602,943 -> 10,000,390; ratio 165:10) [0 scs] --16247-- transtab: dumped 0 (0 -> ??) --16247-- transtab: discarded 126 (2,146 -> ??) --16247-- scheduler: 2,913,868,760 jumps (bb entries). --16247-- scheduler: 34,184/23,957,003 major/minor sched events. --16247-- sanity: 34185 cheap, 1368 expensive checks. --16247-- exectx: 30,011 lists, 1,042 contexts (avg 0 per list) --16247-- exectx: 1,720,628 searches, 1,719,668 full compares (999 per 1000) --16247-- exectx: 38 cmp2, 59,739 cmp4, 0 cmpAll [sbester@box1 mysql-5.1.26-rc-linux-i686-glibc23]$