Bug #20578 memory bug (valgrind) in sctype_latin1 , ysdate_is_now, rpl_insert_ignore
Submitted: 20 Jun 2006 16:03 Modified: 21 Jun 2006 13:32
Reporter: Andrei Elkin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S1 (Critical)
Version:5.0.23 OS:Linux (RHAS3 EM64T Valgrind)
Assigned to: Kristian Nielsen CPU Architecture:Any

[20 Jun 2006 16:03] Andrei Elkin
Description:
Happens w/o replication too.
knielsen wrote in mail:
     The first one seems to be some race (in mysqld.cc?), I think some function is
      called after my_end() that causes my_init() to be called again or something. I
      have not investigated deeply yet. It only occurs sometimes (random error).

From pb's logs:

VALGRIND: '256 bytes in 1 blocks are still reachable in loss record 5 of 7'
    COUNT: 2
    FUNCTION: calloc    FILES:    master.err
    TESTS:    ctype_latin1 sysdate_is_now
    STACK: at 0x4A1A122: calloc (vg_replace_malloc.c:279)
             by 0x940AF9: my_thread_init (my_thr_init.c:170)
             by 0x5A9838: kill_server_thread (mysqld.cc:1022)
             by 0x4D51C63: start_thread (in /lib64/tls/libpthread-0.60.so)
             by 0x540D242: clone (in /lib64/tls/libc-2.3.2.so)

VALGRIND: '256 bytes in 1 blocks are still reachable in loss record 5 of 7'
    COUNT: 1
    FUNCTION: calloc    FILES:    slave.err
    TESTS:    rpl_insert_ignore
    STACK: at 0x4A1A122: calloc (vg_replace_malloc.c:279)
             by 0x940B39: my_thread_init (my_thr_init.c:170)
             by 0x5A9838: kill_server_thread (mysqld.cc:1022)
             by 0x4D51C63: start_thread (in /lib64/tls/libpthread-0.60.so)
             by 0x540D242: clone (in /lib64/tls/libc-2.3.2.so)

How to repeat:
./mysql-test-run ctype_latin1 sysdate_is_now rpl_insert_ignore
[20 Jun 2006 16:24] Andrei Elkin
also rpl000017.
[21 Jun 2006 7:43] Kristian Nielsen
I just discovered that Monty added a suppression for this in 5.1.

I will backport the suppression to 5.0 to remove the Valgrind error report.

Note that this bug is difficult to reproduce (and hence difficult to check if fixed), since it depends on a race condition.
[21 Jun 2006 9:23] Andrei Elkin
I am certain, "almost", this one does nothing to replication for both testcases
and the stack itself.

         STACK: at 0x4A1A122: calloc (vg_replace_malloc.c:279)
             by 0x940AF9: my_thread_init (my_thr_init.c:170)
             by 0x5A9838: kill_server_thread (mysqld.cc:1022)
             by 0x4D51C63: start_thread
[21 Jun 2006 10:56] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/8007
[21 Jun 2006 13:32] Kristian Nielsen
Suppression for this Valgrind error pushed to mysql-5.0.

No changelog entry needed, since this is only silencing a Valgrind warning that is not the
symptom of a real bug.