Bug #43076 rpl.rpl_idempotency fails sporadically on pushbuild
Submitted: 21 Feb 2009 12:09 Modified: 17 Apr 2009 3:02
Reporter: Alfranio Tavares Correia Junior Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Replication Severity:S3 (Non-critical)
Version:6.0-rpl OS:Any (valgrind)
Assigned to: Luis Soares CPU Architecture:Any
Tags: pushbuild, rpl.rpl_idempotency, valgrind

[21 Feb 2009 12:09] Alfranio Tavares Correia Junior
Description:
rpl.rpl_idempotency                      [ fail ]  Found warnings/errors in server log file!
        Test ended at 2009-02-20 08:38:33
file_name	line
/dev/shm/var-ps_row-121/mysqld.2/mysqld.err	==31645==    at 0x4A20848: strlen (mc_replace_strmem.c:246)
/dev/shm/var-ps_row-121/mysqld.2/mysqld.err	==31645==    at 0x4A20848: strlen (mc_replace_strmem.c:246)
^ Found warnings!!
ok

 - saving '/dev/shm/var-ps_row-121/log/rpl.rpl_idempotency/' to '/dev/shm/var-ps_row-121/log/rpl.rpl_idempotency/'

Retrying test, attempt(2/3)...

How to repeat:
pushbuild:

https://intranet.mysql.com/secure/pushbuild/showpush.pl?dir=bzr_mysql-6.0-rpl&order=178 [pb-valgrind-*]

xref:

http://tinyurl.com/cba25k
[18 Mar 2009 16:01] 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/69628

2820 Luis Soares	2009-03-18
      BUG#43076: rpl.rpl_idempotency fails sporadically on pushbuild
      
      When in valgrind mode, this test fails with: 'Conditional jump or move
      depends on uninitialised value(s)' . It seems that the message buffer
      used may sometimes not be NULL terminated. When it is passed on to
      strlen, as part of Protocol::store call, valgrind reports the error.
      
      This patch addresses this issue by fully initializing the message
      buffer and by adding an assertion to the Protocol::store.
     @ sql/protocol.cc
        Added assertion to look for '\0'.
     @ sql/rpl_reporting.h
        Resetting entire message buffer with memset.
[24 Mar 2009 9:42] 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/70152

2833 Luis Soares	2009-03-24
      BUG#43076: rpl.rpl_idempotency fails sporadically on pushbuild
      
      There were some valgrind warnings in strlen. This happened 
      because SHOW SLAVE STATUS connection thread would race with 
      SQL thread for the error message buffer. Sometimes the connection
      thread was getting a half way completed message (ie, string 
      without NULL terminator, causing valgrind to complain with: 
      "Conditional jump or move depends on uninitialised value(s)".
      
      This patch addresses this issue by synchronizing the error object
      between IO/SQL thread and user thread on SHOW SLAVE STATUS.
     @ mysql-test/suite/rpl/r/rpl_reporting.result
        Plain result file.
     @ mysql-test/suite/rpl/t/rpl_reporting.test
        Test case that caused problem to arrise in valgrind PB runs. After this patch
        the warnings should be no more.
     @ sql/log_event.cc
        Small comment on the about access to error message.
     @ sql/protocol.cc
        Assertion to check the presence of '\0' on expected null terminated string.
     @ sql/rpl_reporting.cc
        Added synchronization while writing to last_error.message . Furthermore, 
        added a conditional dbug execution point which enables reproducing 
        the previous faulty behavior and test the fix.
     @ sql/rpl_reporting.h
        Added the mutex as discussed within the team.
     @ sql/slave.cc
        Added synchronization on SHOW SLAVE STATUS.
[27 Mar 2009 12:23] 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/70681

2833 Luis Soares	2009-03-27
      BUG#43076: rpl.rpl_idempotency fails sporadically on pushbuild
      
      There were some valgrind warnings in strlen. This happened 
      because SHOW SLAVE STATUS connection thread would race with 
      SQL thread for the error message buffer. Sometimes the connection
      thread was getting a half way completed message (ie, string 
      without NULL terminator, causing valgrind to complain with: 
      "Conditional jump or move depends on uninitialised value(s)".
      
      This patch addresses this issue by synchronizing the error object
      between IO/SQL thread and user thread on SHOW SLAVE STATUS.
     @ sql/rpl_reporting.cc
        Added unconditional synchronization as requested by reviewer.
     @ sql/rpl_reporting.h
        Added the mutex as discussed within the team. Changes include: mutex variable, mutex initialization, mutex destruction and declared
        Slave_reporting_capability copy constructor and copy assignement operator 
        as private.
     @ sql/slave.cc
        Added synchronization on SHOW SLAVE STATUS.
[30 Mar 2009 13:47] 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/70812

2833 Luis Soares	2009-03-30
      BUG#43076: rpl.rpl_idempotency fails sporadically on pushbuild
      
      There were some valgrind warnings in strlen. This happened 
      because SHOW SLAVE STATUS connection thread would race with 
      SQL thread for the error message buffer. Sometimes the connection
      thread was getting a half way completed message (ie, string 
      without NULL terminator, causing valgrind to complain with: 
      "Conditional jump or move depends on uninitialised value(s)".
      
      This patch addresses this issue by synchronizing the error object
      between IO/SQL thread and user thread on SHOW SLAVE STATUS.
     @ sql/rpl_reporting.cc
        Added unconditional synchronization and destructor implementation as requested by reviewer.
     @ sql/rpl_reporting.h
        Added the mutex as discussed within the team. Changes include: mutex 
        variable, mutex initialization.
        
        Declared Slave_reporting_capability copy constructor and copy 
        assignement operator as private and destructor as virtual.
     @ sql/slave.cc
        Added synchronization on SHOW SLAVE STATUS.
[16 Apr 2009 16:57] Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090416165424-s5jp8a50cqy9zghk) (version source revid:aelkin@mysql.com-20090409153445-gub5s1usmegw6kat) (merge vers: 6.0.11-alpha) (pib:6)
[17 Apr 2009 3:02] Jon Stephens
Documented bugfix in the 6.0.11 changelog as follows:

        The SHOW SLAVE STATUS connection thread competed with the slave 
        SQL thread for use of the error message buffer. As a result, the
        connection thread sometimes received incomplete messages. This issue 
        was uncovered with valgrind when message strings were passed without 
        NULL terminators, causing the error -Conditional jump or move depends 
        on uninitialised value(s)-.
[8 Jul 2009 13:30] Bugs System
Pushed into 5.1.37 (revid:joro@sun.com-20090708131116-kyz8iotbum8w9yic) (version source revid:alfranio.correia@sun.com-20090618182514-j6jn19or61oppc7v) (merge vers: 5.1.36) (pib:11)
[9 Jul 2009 7:37] Bugs System
Pushed into 5.1.37 (revid:joro@sun.com-20090708131116-kyz8iotbum8w9yic) (version source revid:alfranio.correia@sun.com-20090618182514-j6jn19or61oppc7v) (merge vers: 5.1.36) (pib:11)
[10 Jul 2009 11:20] Bugs System
Pushed into 5.4.4-alpha (revid:anozdrin@bk-internal.mysql.com-20090710111017-bnh2cau84ug1hvei) (version source revid:alfranio.correia@sun.com-20090618182943-jmevw7bk9jpwki8p) (merge vers: 5.4.4-alpha) (pib:11)
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-7.0.8 (revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-6.3.27 (revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (version source revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (merge vers: 5.1.37-ndb-6.3.27) (pib:11)
[26 Aug 2009 13:48] Bugs System
Pushed into 5.1.37-ndb-6.2.19 (revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (version source revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (merge vers: 5.1.37-ndb-6.2.19) (pib:11)
[27 Aug 2009 16:32] Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20090827163030-6o3kk6r2oua159hr) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)