Bug #20579 memory bug (valgrind): Syscall param write(buf) points to uninitialised byte
Submitted: 20 Jun 2006 16:16 Modified: 13 Jul 2006 3:50
Reporter: Andrei Elkin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.23 OS:Linux (RHAS3 EM64T Valgrind)
Assigned to: Konstantin Osipov CPU Architecture:Any

[20 Jun 2006 16:16] Andrei Elkin
Description:

VALGRIND: 'Syscall param write(buf) points to uninitialised byte(s)'
    COUNT: 1
    FUNCTION: (within /lib64/tls/libpthread-0.60.so)    FILES:    slave.err
    TESTS:    rpl_trigger
    STACK: at 0x4D56ADF: (within /lib64/tls/libpthread-0.60.so)
             by 0x924974: my_write (my_write.c:35)
             by 0x92A318: my_b_flush_io_cache (mf_iocache.c:1210)
             by 0x62C9D4: MYSQL_LOG::write(Log_event*) (log.cc:1554)
             by 0x617C73: mysql_insert(THD*, st_table_list*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool) (sql_insert.cc:570)
             by 0x5C4214: mysql_execute_command(THD*) (sql_parse.cc:3299)
             by 0x5C96E1: mysql_parse(THD*, char*, unsigned) (sql_parse.cc:5738)
             by 0x6369D9: Query_log_event::exec_event(st_relay_log_info*, char const*, unsigned) (log_event.cc:1745)
             by 0x6D6EF6: exec_relay_log_event(THD*, st_relay_log_info*) (slave.cc:3336)
             by 0x6D3FD1: handle_slave_sql (slave.cc:3891)
             by 0x4D51C63: start_thread (in /lib64/tls/libpthread-0.60.so)
             by 0x540D242: clone (in /lib64/tls/libc-2.3.2.so)
           Address 0x55A8C72 is 58 bytes inside a block of size 8,192 alloc'd
             at 0x4A18B63: malloc (vg_replace_malloc.c:149)
             by 0x92B85C: my_malloc (my_malloc.c:35)
             by 0x928FCB: init_io_cache (mf_iocache.c:215)
             by 0x62DD18: MYSQL_LOG::open(char const*, enum_log_type, char const*, cache_type, bool, unsigned long, bool) (log.cc:548)
             by 0x5AD521: init_server_components() (mysqld.cc:3157)
             by 0x5AA719: main (mysqld.cc:3431)

It might relate to bug#19022.

How to repeat:
mysql-test-run  rpl_trigger
[21 Jun 2006 9:22] Andrei Elkin
should relate to bug#19022: Memory bug when switching db during
trigger execution. 

My conclusion is based on observation of #20579 fails on 

             by 0x617C73: mysql_insert(THD*, st_table_list*, List<Item>&,
List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool)
(sql_insert.cc:570)

which is the following, not the preceeding!, to #19022's failing line:

             by 0x5F859F: mysql_insert(THD*, st_table_list*, List<Item>&,
List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool)
(sql_insert.cc:569)

I assume we are better to check the case with #19022 fix first.
[27 Jun 2006 23:22] Konstantin Osipov
Lars, please review or assign a reviewer.
Thanks.
[28 Jun 2006 19:49] Konstantin Osipov
This is the same patch as the patch for Bug#19022.
Approved over email and irc by Andrei Elkin.
[28 Jun 2006 19:49] Konstantin Osipov
Pushed into 5.0-runtime.
[30 Jun 2006 12:34] Konstantin Osipov
Pushed into 5.0-release and 5.0
[6 Jul 2006 19:32] Paul Dubois
Noted in 5.0.23 changelog.

Will need three-part version number for 5.1
when the patch merges up.
[7 Jul 2006 18:13] Konstantin Osipov
Merged into 5.1 tree currently tagged 5.1.12
[13 Jul 2006 3:50] Paul Dubois
Noted in 5.1.12 changelog.