Bug #45967 Test alias fails under valgrind
Submitted: 6 Jul 2009 11:30 Modified: 10 Jul 2009 13:23
Reporter: Sveta Smirnova Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:5.1, azalea OS:Linux
Assigned to: Georgi Kodinov CPU Architecture:Any

[6 Jul 2009 11:30] Sveta Smirnova
Description:
./mtr --valgrind alias fails with:

==15441== Syscall param pwrite64(buf) points to uninitialised byte(s)
==15441==    at 0x3429E0D708: (within /lib64/libpthread-2.5.so)
==15441==    by 0x867478: my_pwrite (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x8689D7: flush_cached_blocks (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x86A5C6: flush_key_blocks_int (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x86AD4A: flush_key_blocks (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x839904: mi_lock_database (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x69DB09: handler::ha_external_lock(THD*, int) (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x5A7960: mysql_unlock_tables(THD*, st_mysql_lock*) (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x5F8DDB: close_thread_tables(THD*) (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x5C5B0A: dispatch_command(enum_server_command, THD*, char*, unsigned) (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x5C6F87: do_command(THD*) (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x5B96CC: handle_one_connection (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x3429E061B4: start_thread (in /lib64/libpthread-2.5.so)
==15441==    by 0x34292CD39C: clone (in /lib64/libc-2.5.so)
==15441==  Address 0x516AF04 is 2,060 bytes inside a block of size 857,088 alloc'd
==15441==    at 0x4A05809: malloc (vg_replace_malloc.c:149)
==15441==    by 0x86E291: my_malloc (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x883091: my_large_malloc (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x867E6A: init_key_cache (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x69E2D9: ha_init_key_cache (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x5C8202: process_key_caches(int (*)(char const*, st_key_cache*)) (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x5B1001: _ZL22init_server_componentsv (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
==15441==    by 0x5B419D: main (in /users/ssmirnova/src/mysql-5.1/sql/mysqld)
--15441-- WARNING: unhandled syscall: 142

How to repeat:
./mtr --valgrind alias

$valgrind --version
valgrind-3.2.1

$uname -a
Linux host.mysql.com 2.6.18-8.1.1.el5 #1 SMP Mon Feb 26 20:37:57 EST 2007 x86_64 x86_64 x86_64 GNU/Linux
[10 Jul 2009 13:23] Georgi Kodinov
Sveta,

I've tried with the latest 5.1-bugteam bzr repository on a fully updated Fedora 10 x86_64 with valgrind-3.4.1 compiled as an RPM. I'm not getting these warnings with alias.test. I'm getting others, but they're already reported in bug#46003 and bug#46034. By looking at the callstacks imho these are glibc problems. Please update either update your installation or try adding a suppression to valgrind.supp that stops these warnings on your particular platform/glibc combination.
 
My versions are as follows :
$ /lib/libc.so.6 
GNU C Library stable release version 2.9, by Roland McGrath et al.
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.3.2 20081105 (Red Hat 4.3.2-7).
Compiled on a Linux >>2.6.18-92.1.18.el5<< system on 2008-12-08.
Available extensions:
        The C stubs add-on version 2.1.2.
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        Native POSIX Threads Library by Ulrich Drepper et al
        BIND-8.2.3-T5B
        RT using linux kernel aio
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.

$ uname -a 
Linux magare 2.6.27.25-170.2.72.fc10.x86_64 #1 SMP Sun Jun 21 18:39:34 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

$ valgrind --version
valgrind-3.4.1

$ gcc --version
gcc (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7)
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.