List:Commits« Previous MessageNext Message »
From:Luis Soares Date:March 18 2009 4:01pm
Subject:bzr commit into mysql-6.0-rpl branch (luis.soares:2820) Bug#43076
View as plain text  
#At file:///home/lsoares/Workspace/mysql-server/bugfix/43076/6.0-rpl/ based on revid:zhenxing.he@stripped

 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.

    modified:
      sql/protocol.cc
      sql/rpl_reporting.h
=== modified file 'sql/protocol.cc'
--- a/sql/protocol.cc	2009-02-13 17:12:39 +0000
+++ b/sql/protocol.cc	2009-03-18 16:01:03 +0000
@@ -834,6 +834,8 @@ bool Protocol::send_result_set_row(List<
 
 bool Protocol::store(const char *from, CHARSET_INFO *cs)
 {
+  /* when in debug mode, assert that from is null or is null terminated */
+  DBUG_ASSERT(!from || (strchr(from, '\0') != NULL));
   if (!from)
     return store_null();
   uint length= strlen(from);

=== modified file 'sql/rpl_reporting.h'
--- a/sql/rpl_reporting.h	2007-06-11 20:15:39 +0000
+++ b/sql/rpl_reporting.h	2009-03-18 16:01:03 +0000
@@ -61,7 +61,7 @@ public:
     void clear()
     {
       number= 0;
-      message[0]= '\0';
+      memset(message, '\0', MAX_SLAVE_ERRMSG);
     }
 
     /** Error code */


Attachment: [text/bzr-bundle] bzr/luis.soares@sun.com-20090318160103-zlp1xivegpy8lwl3.bundle
Thread
bzr commit into mysql-6.0-rpl branch (luis.soares:2820) Bug#43076Luis Soares18 Mar
  • Re: bzr commit into mysql-6.0-rpl branch (luis.soares:2820) Bug#43076Alfranio Correia19 Mar
  • Re: bzr commit into mysql-6.0-rpl branch (luis.soares:2820) Bug#43076Mats Kindahl23 Mar