[MDEV-333] Valgrind warning "Syscall param pwrite64(buf) points to uninitialised byte(s)" on OPTIMIZE with a partitioned table Created: 2012-06-11  Updated: 2014-04-09  Resolved: 2014-04-09

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5.36
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Michael Widenius
Resolution: Fixed Votes: 0
Labels: upstream


 Description   

Also filed as http://bugs.mysql.com/bug.php?id=65585

==10915== Syscall param pwrite64(buf) points to uninitialised byte(s)
==10915==    at 0x5046A73: ??? (syscall-template.S:82)
==10915==    by 0xCAA659: my_pwrite (my_pread.c:145)
==10915==    by 0xC33C92: inline_mysql_file_pwrite (mysql_file.h:1201)
==10915==    by 0xC388E1: mi_state_info_write (mi_open.c:928)
==10915==    by 0xC1CECC: update_state_info (mi_check.c:4459)
==10915==    by 0xC091C6: ha_myisam::repair(THD*, st_handler_check_param&, bool) (ha_myisam.cc:1169)
==10915==    by 0xC08776: ha_myisam::optimize(THD*, st_ha_check_opt*) (ha_myisam.cc:1026)
==10915==    by 0x7C49EC: handler::ha_optimize(THD*, st_ha_check_opt*) (handler.cc:3512)
==10915==    by 0xC72BA0: handle_opt_part(THD*, st_ha_check_opt*, handler*, unsigned int) (ha_partition.cc:1054)
==10915==    by 0xC732DE: ha_partition::handle_opt_partitions(THD*, st_ha_check_opt*, unsigned int) (ha_partition.cc:1206)
==10915==    by 0xC72944: ha_partition::optimize(THD*, st_ha_check_opt*) (ha_partition.cc:927)
==10915==    by 0x7C49EC: handler::ha_optimize(THD*, st_ha_check_opt*) (handler.cc:3512)
==10915==    by 0x717B19: mysql_admin_table(THD*, TABLE_LIST*, st_ha_check_opt*, char const*, thr_lock_type, bool, bool, unsigned int, int (*)(THD*, TABLE_LIST*, st_ha_check_opt*), int (handler::*)(THD*, st_ha_check_opt*), int (*)(THD*, TABLE_LIST*)) (sql_admin.cc:643)
==10915==    by 0x7193C2: Optimize_table_statement::execute(THD*) (sql_admin.cc:1055)
==10915==    by 0x92FAE3: Alter_table_optimize_partition_statement::execute(THD*) (sql_partition_admin.cc:84)
==10915==    by 0x61245C: mysql_execute_command(THD*) (sql_parse.cc:4454)
==10915==  Address 0x40c6c6c is on thread 4's stack

Reproducible on maria/5.5 revno 3426, mysql-5.5, mysql-trunk.
Reproducible with MyISAM and Aria.

Test case:

CREATE TABLE t1 (a INT, KEY (a)) ENGINE=MyISAM
  PARTITION BY KEY(a) PARTITIONS 2;
INSERT INTO t1 VALUES (3),(5),(1),(2);
ALTER TABLE t1 DISABLE KEYS;
ALTER TABLE t1 OPTIMIZE PARTITION p0;



 Comments   
Comment by Sergei Golubchik [ 2013-01-01 ]

fixed in mysql-5.6.8

Comment by Elena Stepanova [ 2014-04-09 ]

The bug disappeared from 10.0 tree after merge 5.6=>10.0.4. The test case passes since the following revision:

       revno: 3492.3.17
        revision-id: monty@askmonty.org-20130627110103-pv8khr2rjxbrlzyo
        parent: sanja@montyprogram.com-20130626101727-j5tksg7zaeunq66a
        committer: Michael Widenius <monty@askmonty.org>
        branch nick: maria-10.0-merge
        timestamp: Thu 2013-06-27 14:01:03 +0300
        message:
          ha_partition.cc and ha_partition.h are now completely merged
          Added sql_mode_t to simplify merges

Generated at Thu Feb 08 06:27:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.