Description:
The following two MTR test cases generate
'Syscall param pwrite64(buf) points to uninitialised byte(s)'
Valgrind error
innodb.check_sector_size
innodb.create_isl_with_direct
**************************************************************************
Syscall param pwrite64(buf) points to uninitialised byte(s)
at 0x5F8104F: pwrite (pwrite64.c:29)
by 0x1A70E49: os_fusionio_get_sector_size() (os0file.cc:6676)
by 0x1A71258: os_aio_init(unsigned long, unsigned long, unsigned long) (os0file.cc:6746)
by 0x1B9B28E: innobase_start_or_create_for_mysql() (srv0start.cc:1788)
by 0x1995B9C: innobase_init(void*) (ha_innodb.cc:4056)
by 0xF370E6: ha_initialize_handlerton(st_plugin_int*) (handler.cc:840)
by 0x15E38BC: plugin_initialize(st_plugin_int*) (sql_plugin.cc:1225)
by 0x15E45D3: plugin_register_builtin_and_init_core_se(int*, char**) (sql_plugin.cc:1588)
by 0xEA0A5E: init_server_components() (mysqld.cc:4074)
by 0xEA20FF: mysqld_main(int, char**) (mysqld.cc:4768)
by 0xE99119: main (main.cc:25)
Address 0xa1e8800 is 128 bytes inside a block of size 8,216 alloc'd
at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x19BB25D: ut_allocator<unsigned char>::allocate(unsigned long, unsigned char const*, char const*, bool, bool) (ut0new.h:351)
by 0x1A70DF5: os_fusionio_get_sector_size() (os0file.cc:6671)
by 0x1A71258: os_aio_init(unsigned long, unsigned long, unsigned long) (os0file.cc:6746)
by 0x1B9B28E: innobase_start_or_create_for_mysql() (srv0start.cc:1788)
by 0x1995B9C: innobase_init(void*) (ha_innodb.cc:4056)
by 0xF370E6: ha_initialize_handlerton(st_plugin_int*) (handler.cc:840)
by 0x15E38BC: plugin_initialize(st_plugin_int*) (sql_plugin.cc:1225)
by 0x15E45D3: plugin_register_builtin_and_init_core_se(int*, char**) (sql_plugin.cc:1588)
by 0xEA0A5E: init_server_components() (mysqld.cc:4074)
by 0xEA20FF: mysqld_main(int, char**) (mysqld.cc:4768)
by 0xE99119: main (main.cc:25)
**************************************************************************
How to repeat:
Build MySQL Server 5.7.23 on Ubuntu 18.10 (Bionic) with Valgrind cmake option
(Using default GCC 7.3.0 and Valgring 3.13.0)
cmake ... -DWITH_VALGRIND=ON
then run
./mtr --debug-server --valgrind innodb.check_sector_size
Suggested fix:
In 'os_fusionio_get_sector_size()' in 'os0file.cc' change
ptr = static_cast<byte*>(ut_malloc_nokey(2 * MAX_SECTOR_SIZE));
to
ptr = static_cast<byte*>(ut_zalloc_nokey(2 * MAX_SECTOR_SIZE));
Probably conditionally, depending on UNIV_DEBUG_VALGRIND preprocessor definition.