[sbester@levovo mysql-5.5.11-linux-x86_64]$ valgrind -v --leak-check=full --show-reachable=yes --db-attach=yes --track-origins=yes --tool=memcheck --num-callers=50 ./bin/mysqld --no-defaults --basedir=. --datadir=/media/1TB/data --skip-gr --myisam-recover=force --open-files-limit=2000 --port=3306 --tmpdir=. --socket=sock --gdb --skip-na --innodb-flush-log-at-trx-commit=0 --innodb-lock-wait-timeout=1 --port=3306 --datadir=./data ==8303== Memcheck, a memory error detector ==8303== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==8303== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info ==8303== Command: ./bin/mysqld --no-defaults --basedir=. --datadir=/media/1TB/data --skip-gr --myisam-recover=force --open-files-limit=2000 --port=3306 --tmpdir=. --socket=sock --gdb --skip-na --innodb-flush-log-at-trx-commit=0 --innodb-lock-wait-timeout=1 --port=3306 --datadir=./data ==8303== --8303-- Valgrind options: --8303-- -v --8303-- --leak-check=full --8303-- --show-reachable=yes --8303-- --db-attach=yes --8303-- --track-origins=yes --8303-- --tool=memcheck --8303-- --num-callers=50 --8303-- Contents of /proc/version: --8303-- Linux version 2.6.33.3-85.fc13.x86_64 (mockbuild@x86-02.phx2.fedoraproject.org) (gcc version 4.4.4 20100503 (Red Hat 4.4.4-2) (GCC) ) #1 SMP Thu May 6 18:09:49 UTC 2010 --8303-- Arch and hwcaps: AMD64, amd64-sse3-cx16 --8303-- Page sizes: currently 4096, max supported 4096 --8303-- Valgrind library directory: /usr/lib64/valgrind --8303-- Reading syms from /media/1TB/mysql/mysql-5.5.11-linux-x86_64/bin/mysqld (0x400000) --8303-- Reading syms from /usr/lib64/valgrind/memcheck-amd64-linux (0x38000000) --8303-- object doesn't have a dynamic symbol table --8303-- Reading syms from /lib64/ld-2.12.so (0x30e1000000) --8303-- Reading debug info from /usr/lib/debug/lib64/ld-2.12.so.debug .. --8303-- Reading suppressions file: /usr/lib64/valgrind/default.supp --8303-- REDIR: 0x30e1017590 (strlen) redirected to 0x3803f6f7 (vgPlain_amd64_linux_REDIR_FOR_strlen) --8303-- Reading syms from /usr/lib64/valgrind/vgpreload_core-amd64-linux.so (0x4801000) --8303-- Reading syms from /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so (0x4a02000) ==8303== WARNING: new redirection conflicts with existing -- ignoring it --8303-- new: 0x30e1017590 (strlen ) R-> 0x04a06340 strlen --8303-- REDIR: 0x30e1017400 (index) redirected to 0x4a05f80 (index) --8303-- REDIR: 0x30e1017480 (strcmp) redirected to 0x4a06900 (strcmp) --8303-- Reading syms from /lib64/libpthread-2.12.so (0x30e1800000) --8303-- Reading debug info from /usr/lib/debug/lib64/libpthread-2.12.so.debug .. --8303-- Reading syms from /lib64/libz.so.1.2.3 (0x30e2400000) --8303-- Reading debug info from /usr/lib/debug/lib64/libz.so.1.2.3.debug .. --8303-- Reading syms from /lib64/libm-2.12.so (0x30e1c00000) --8303-- Reading debug info from /usr/lib/debug/lib64/libm-2.12.so.debug .. --8303-- Reading syms from /lib64/librt-2.12.so (0x30e2800000) --8303-- Reading debug info from /usr/lib/debug/lib64/librt-2.12.so.debug .. --8303-- Reading syms from /lib64/libcrypt-2.12.so (0x3ce5000000) --8303-- Reading debug info from /usr/lib/debug/lib64/libcrypt-2.12.so.debug .. --8303-- Reading syms from /lib64/libdl-2.12.so (0x30e2000000) --8303-- Reading debug info from /usr/lib/debug/lib64/libdl-2.12.so.debug .. --8303-- Reading syms from /lib64/libc-2.12.so (0x30e1400000) --8303-- Reading debug info from /usr/lib/debug/lib64/libc-2.12.so.debug .. --8303-- Reading syms from /lib64/libfreebl3.so (0x3ce4c00000) --8303-- Reading debug info from /usr/lib/debug/lib64/libfreebl3.so.debug .. --8303-- REDIR: 0x30e1481ad0 (__GI_strrchr) redirected to 0x4a05e00 (__GI_strrchr) --8303-- REDIR: 0x30e147ffe0 (strlen) redirected to 0x480155c (_vgnU_ifunc_wrapper) ==8303== WARNING: new redirection conflicts with existing -- ignoring it --8303-- new: 0x30e1480010 (__GI_strlen ) R-> 0x04a062e0 strlen --8303-- REDIR: 0x30e1480010 (__GI_strlen) redirected to 0x4a06300 (__GI_strlen) --8303-- REDIR: 0x30e1482850 (memset) redirected to 0x4a07540 (memset) --8303-- REDIR: 0x30e1479610 (calloc) redirected to 0x4a043d3 (calloc) --8303-- REDIR: 0x30e147e5a0 (strcmp) redirected to 0x480155c (_vgnU_ifunc_wrapper) --8303-- REDIR: 0x30e1527820 (__strcmp_ssse3) redirected to 0x4a06860 (strcmp) --8303-- REDIR: 0x30e1480060 (strnlen) redirected to 0x4a06280 (strnlen) --8303-- REDIR: 0x30e1482690 (memmove) redirected to 0x4a075b0 (memmove) --8303-- REDIR: 0x30e1485260 (strchrnul) redirected to 0x4a07620 (strchrnul) --8303-- REDIR: 0x30e1483c60 (memcpy) redirected to 0x4a069d0 (memcpy) --8303-- REDIR: 0x30e14799d0 (malloc) redirected to 0x4a050db (malloc) --8303-- Reading syms from /lib64/libgcc_s-4.4.4-20100630.so.1 (0x30ec000000) --8303-- Reading debug info from /usr/lib/debug/lib64/libgcc_s-4.4.4-20100630.so.1.debug .. ==8303== WARNING: new redirection conflicts with existing -- ignoring it --8303-- new: 0x30e1480010 (__GI_strlen ) R-> 0x04a062e0 strlen --8303-- REDIR: 0x30e147a750 (free) redirected to 0x4a04ceb (free) --8303-- REDIR: 0x30e1480220 (__GI_strncmp) redirected to 0x4a06800 (__GI_strncmp) --8303-- REDIR: 0x30e147fa30 (strcpy) redirected to 0x480155c (_vgnU_ifunc_wrapper) --8303-- REDIR: 0x30e1524280 (???) redirected to 0x4a06360 (strcpy) --8303-- REDIR: 0x30e1482260 (bcmp) redirected to 0x480155c (_vgnU_ifunc_wrapper) --8303-- REDIR: 0x30e1482290 (__GI_memcmp) redirected to 0x4a07160 (bcmp) --8303-- REDIR: 0x30e147abd0 (realloc) redirected to 0x4a0518c (realloc) --8303-- REDIR: 0x30e147fa60 (__GI_strcpy) redirected to 0x4a06430 (__GI_strcpy) --8303-- REDIR: 0x30e147e5e0 (__GI_strcmp) redirected to 0x4a068b0 (__GI_strcmp) --8303-- REDIR: 0xffffffffff600400 (???) redirected to 0x3803f6ed (vgPlain_amd64_linux_REDIR_FOR_vtime) --8303-- REDIR: 0x30e1485210 (__GI___rawmemchr) redirected to 0x4a07670 (__GI___rawmemchr) --8303-- REDIR: 0x30e1481aa0 (rindex) redirected to 0x480155c (_vgnU_ifunc_wrapper) ==8303== WARNING: new redirection conflicts with existing -- ignoring it --8303-- new: 0x30e1481ad0 (__GI_strrchr ) R-> 0x04a05dd0 rindex --8303-- REDIR: 0x30e147e4f0 (index) redirected to 0x480155c (_vgnU_ifunc_wrapper) ==8303== WARNING: new redirection conflicts with existing -- ignoring it --8303-- new: 0x30e147e520 (__GI_strchr ) R-> 0x04a05e90 index --8303-- REDIR: 0x30e147e520 (__GI_strchr) redirected to 0x4a05ec0 (__GI_strchr) --8303-- REDIR: 0x30e1480140 (strncat) redirected to 0x4a06170 (strncat) --8303-- REDIR: 0x30e1483380 (mempcpy) redirected to 0x4a07690 (mempcpy) --8303-- REDIR: 0x30e14821e0 (memchr) redirected to 0x4a069a0 (memchr) --8303-- REDIR: 0x30e1483990 (stpcpy) redirected to 0x480155c (_vgnU_ifunc_wrapper) --8303-- REDIR: 0x30e1525c20 (???) redirected to 0x4a07200 (stpcpy) --8303-- REDIR: 0x30e14801e0 (strncmp) redirected to 0x480155c (_vgnU_ifunc_wrapper) --8303-- REDIR: 0x30e1528a80 (__strncmp_ssse3) redirected to 0x4a067a0 (strncmp) 110314 20:43:17 [Note] Plugin 'FEDERATED' is disabled. 110314 20:43:17 InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!! 110314 20:43:17 InnoDB: The InnoDB memory heap is disabled 110314 20:43:17 InnoDB: Mutexes and rw_locks use GCC atomic builtins 110314 20:43:17 InnoDB: Compressed tables use zlib 1.2.3 --8303-- REDIR: 0xffffffffff600000 (???) redirected to 0x3803f6e3 (vgPlain_amd64_linux_REDIR_FOR_vgettimeofday) 110314 20:43:19 InnoDB: Initializing buffer pool, size = 128.0M 110314 20:43:24 InnoDB: Completed initialization of buffer pool InnoDB: The first specified data file ./ibdata1 did not exist: InnoDB: a new database to be created! 110314 20:43:24 InnoDB: Setting file ./ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait... 110314 20:43:25 InnoDB: Log file ./ib_logfile0 did not exist: new to be created InnoDB: Setting log file ./ib_logfile0 size to 5 MB InnoDB: Database physically writes the file full: wait... 110314 20:43:25 InnoDB: Log file ./ib_logfile1 did not exist: new to be created InnoDB: Setting log file ./ib_logfile1 size to 5 MB InnoDB: Database physically writes the file full: wait... InnoDB: Doublewrite buffer not found: creating new InnoDB: Doublewrite buffer created InnoDB: 127 rollback segment(s) active. InnoDB: Creating foreign key constraint system tables InnoDB: Foreign key constraint system tables created 110314 20:46:46 InnoDB: 1.1.6 started; log sequence number 0 110314 20:46:50 [Note] ./bin/mysqld: ready for connections. Version: '5.5.11-valgrind-max-debug' socket: 'sock' port: 3306 Source distribution ==8303== Thread 17: ==8303== Invalid read of size 8 ==8303== at 0x72BC5B: Field::make_field(Send_field*) (field.cc:1555) ==8303== by 0x76B2A7: Item_field::make_field(Send_field*) (item.cc:5298) ==8303== by 0x566B5F: Protocol::send_result_set_metadata(List*, unsigned int) (protocol.cc:703) ==8303== by 0x5C1C08: select_send::send_result_set_metadata(List&, unsigned int) (sql_class.cc:1805) ==8303== by 0x60D596: Select_fetch_protocol_binary::send_result_set_metadata(List&, unsigned int) (sql_prepare.cc:2880) ==8303== by 0x86A173: Materialized_cursor::open(JOIN*) (sql_cursor.cc:277) ==8303== by 0x869BBF: mysql_open_cursor(THD*, select_result*, Server_side_cursor**) (sql_cursor.cc:145) ==8303== by 0x60F6EE: Prepared_statement::execute(String*, bool) (sql_prepare.cc:3748) ==8303== by 0x60E872: Prepared_statement::execute_loop(String*, bool, unsigned char*, unsigned char*) (sql_prepare.cc:3418) ==8303== by 0x60C9AE: mysqld_stmt_execute(THD*, char*, unsigned int) (sql_prepare.cc:2560) ==8303== by 0x5EDEDA: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:986) ==8303== by 0x5ED42F: do_command(THD*) (sql_parse.cc:771) ==8303== by 0x6CB1AA: do_handle_one_connection(THD*) (sql_connect.cc:771) ==8303== by 0x6CAD3B: handle_one_connection (sql_connect.cc:707) ==8303== by 0x30E1807760: start_thread (pthread_create.c:301) ==8303== by 0x1A28170F: ??? ==8303== Address 0xf883720 is 16 bytes inside a block of size 4,736 free'd ==8303== at 0x4A04D72: free (vg_replace_malloc.c:325) ==8303== by 0x8BD66B: my_free (my_malloc.c:128) ==8303== by 0x8B5281: free_root (my_alloc.c:365) ==8303== by 0x638A1B: free_tmp_table(THD*, TABLE*) (sql_select.cc:11179) ==8303== by 0x59E379: close_thread_tables(THD*) (sql_base.cc:1436) ==8303== by 0x5F7763: mysql_execute_command(THD*) (sql_parse.cc:4369) ==8303== by 0x869B16: mysql_open_cursor(THD*, select_result*, Server_side_cursor**) (sql_cursor.cc:117) ==8303== by 0x60F6EE: Prepared_statement::execute(String*, bool) (sql_prepare.cc:3748) ==8303== by 0x60E872: Prepared_statement::execute_loop(String*, bool, unsigned char*, unsigned char*) (sql_prepare.cc:3418) ==8303== by 0x60C9AE: mysqld_stmt_execute(THD*, char*, unsigned int) (sql_prepare.cc:2560) ==8303== by 0x5EDEDA: dispatch_command(enum_server_command, THD*, char*, unsigned int) (sql_parse.cc:986) ==8303== by 0x5ED42F: do_command(THD*) (sql_parse.cc:771) ==8303== by 0x6CB1AA: do_handle_one_connection(THD*) (sql_connect.cc:771) ==8303== by 0x6CAD3B: handle_one_connection (sql_connect.cc:707) ==8303== by 0x30E1807760: start_thread (pthread_create.c:301) ==8303== by 0x1A28170F: ??? ==8303== ==8303== ==8303== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c] ---- y ==8303== starting debugger with cmd: /usr/bin/gdb -nw /proc/8901/fd/10000 8901 GNU gdb (GDB) Fedora (7.1-18.fc13) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /proc/8901/fd/10000...done. Attaching to program: /proc/8901/fd/10000, process 8901 Reading symbols from /usr/lib64/valgrind/vgpreload_core-amd64-linux.so...done. Loaded symbols for /usr/lib64/valgrind/vgpreload_core-amd64-linux.so Reading symbols from /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so...done. Loaded symbols for /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so Reading symbols from /lib64/libpthread.so.0...Reading symbols from /usr/lib/debug/lib64/libpthread-2.12.so.debug...done. [Thread debugging using libthread_db enabled] done. Loaded symbols for /lib64/libpthread.so.0 Reading symbols from /lib64/libz.so.1...Reading symbols from /usr/lib/debug/lib64/libz.so.1.2.3.debug...done. done. Loaded symbols for /lib64/libz.so.1 Reading symbols from /lib64/libm.so.6...Reading symbols from /usr/lib/debug/lib64/libm-2.12.so.debug...done. done. Loaded symbols for /lib64/libm.so.6 Reading symbols from /lib64/librt.so.1...Reading symbols from /usr/lib/debug/lib64/librt-2.12.so.debug...done. done. Loaded symbols for /lib64/librt.so.1 Reading symbols from /lib64/libcrypt.so.1...Reading symbols from /usr/lib/debug/lib64/libcrypt-2.12.so.debug...done. done. Loaded symbols for /lib64/libcrypt.so.1 Reading symbols from /lib64/libdl.so.2...Reading symbols from /usr/lib/debug/lib64/libdl-2.12.so.debug...done. done. Loaded symbols for /lib64/libdl.so.2 Reading symbols from /lib64/libc.so.6...Reading symbols from /usr/lib/debug/lib64/libc-2.12.so.debug...done. done. Loaded symbols for /lib64/libc.so.6 Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug/lib64/ld-2.12.so.debug...done. done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 Reading symbols from /lib64/libfreebl3.so...Reading symbols from /usr/lib/debug/lib64/libfreebl3.so.debug...done. done. Loaded symbols for /lib64/libfreebl3.so Reading symbols from /lib64/libgcc_s.so.1...Reading symbols from /usr/lib/debug/lib64/libgcc_s-4.4.4-20100630.so.1.debug...done. done. Loaded symbols for /lib64/libgcc_s.so.1 0x000000000072bc5b in Field::make_field (this=0xf88af10, field=0x1a27f9b0) at /home/sbester/build/bzr/mysql-5.5-security/sql/field.cc:1555 1555 if (orig_table && orig_table->s->db.str && *orig_table->s->db.str) (gdb) p orig_table $1 = (TABLE *) 0xf883720 (gdb) p orig_table->s->db.str $2 = 0xb5a2d7 "information_schema" (gdb) p *orig_table->s->db.str $3 = 105 'i' (gdb) where #0 0x000000000072bc5b in Field::make_field (this=0xf88af10, field=0x1a27f9b0) at /home/sbester/build/bzr/mysql-5.5-security/sql/field.cc:1555 #1 0x000000000076b2a8 in Item_field::make_field (this=0xf890290, tmp_field=0x1a27f9b0) at /home/sbester/build/bzr/mysql-5.5-security/sql/item.cc:5298 #2 0x0000000000566b60 in Protocol::send_result_set_metadata (this=0xf8804e8, list=0xf890200, flags=1) at /home/sbester/build/bzr/mysql-5.5-security/sql/protocol.cc:703 #3 0x00000000005c1c09 in select_send::send_result_set_metadata (this=0xf8804c0, list=..., flags=1) at /home/sbester/build/bzr/mysql-5.5-security/sql/sql_class.cc:1805 #4 0x000000000060d597 in Select_fetch_protocol_binary::send_result_set_metadata (this=0xf8804c0, list=..., flags=1) at /home/sbester/build/bzr/mysql-5.5-security/sql/sql_prepare.cc:2880 #5 0x000000000086a174 in Materialized_cursor::open (this=0xf88fb60, join=0x0) at /home/sbester/build/bzr/mysql-5.5-security/sql/sql_cursor.cc:277 #6 0x0000000000869bc0 in mysql_open_cursor (thd=0xf494230, result=0xf8804c0, pcursor=0xf880528) at /home/sbester/build/bzr/mysql-5.5-security/sql/sql_cursor.cc:145 #7 0x000000000060f6ef in Prepared_statement::execute (this=0xf880430, expanded_query=0x1a27fef0, open_cursor=true) at /home/sbester/build/bzr/mysql-5.5-security/sql/sql_prepare.cc:3748 #8 0x000000000060e873 in Prepared_statement::execute_loop (this=0xf880430, expanded_query=0x1a27fef0, open_cursor=true, packet=0x15ed517a "", packet_end=0x15ed517a "") at /home/sbester/build/bzr/mysql-5.5-security/sql/sql_prepare.cc:3418 #9 0x000000000060c9af in mysqld_stmt_execute (thd=0xf494230, packet_arg=0x15ed5171 "", packet_length=9) at /home/sbester/build/bzr/mysql-5.5-security/sql/sql_prepare.cc:2560 #10 0x00000000005ededb in dispatch_command (command=COM_STMT_EXECUTE, thd=0xf494230, packet=0x15ed5171 "", packet_length=9) at /home/sbester/build/bzr/mysql-5.5-security/sql/sql_parse.cc:986 #11 0x00000000005ed430 in do_command (thd=0xf494230) at /home/sbester/build/bzr/mysql-5.5-security/sql/sql_parse.cc:771 #12 0x00000000006cb1ab in do_handle_one_connection (thd_arg=0xf494230) at /home/sbester/build/bzr/mysql-5.5-security/sql/sql_connect.cc:771 #13 0x00000000006cad3c in handle_one_connection (arg=0xf494230) at /home/sbester/build/bzr/mysql-5.5-security/sql/sql_connect.cc:707 #14 0x00000030e1807761 in start_thread (arg=0x1a281710) at pthread_create.c:301 #15 0x00000030e14e14ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115 (gdb) (gdb) list 1550 } 1551 1552 1553 void Field::make_field(Send_field *field) 1554 { 1555 if (orig_table && orig_table->s->db.str && *orig_table->s->db.str) 1556 { 1557 field->db_name= orig_table->s->db.str; 1558 if (orig_table->pos_in_table_list && 1559 orig_table->pos_in_table_list->schema_table) (gdb)