Hi Luis,
After talking to you on phone, I have the following suggestions:
1 - Put a similar assertion where the variable is updated by the SQL Thread.
2 - Remove the following code
+ memset(message, '\0', MAX_SLAVE_ERRMSG);
and keep
- message[0]= '\0';
You are hiding the original problem with this approach.
3 - If there is no concurrency problem (i.e. lack of mutex), push
the patch after the changes suggested here.
By doing this, we can get more information on what is happening.
Luis Soares wrote:
> #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 */
>
>
> ------------------------------------------------------------------------
>
>
>