Bug #44378 rpl_binlog_corruption fails with warning messages in Valgrind
Submitted: 21 Apr 2009 9:39 Modified: 7 May 2009 13:27
Reporter: Alfranio Tavares Correia Junior Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.1, 6.0 OS:Any
Assigned to: Alfranio Tavares Correia Junior CPU Architecture:Any
Tags: replication, valgrind

[21 Apr 2009 9:39] Alfranio Tavares Correia Junior
Description:
==19390== Conditional jump or move depends on uninitialised value(s)
==19390==    at 0x84859CE: Incident_log_event::is_valid() const (log_event.h:3907)
==19390==    by 0x8482024: Log_event::read_log_event(char const*, unsigned, char const**, Format_description_log_event const*) (log_event.cc:1227)
==19390==    by 0x8482434: Log_event::read_log_event(st_io_cache*, st_safe_mutex_t*, Format_description_log_event const*) (log_event.cc:1034)
==19390==    by 0x8521A25: _ZL10next_eventP14Relay_log_info (slave.cc:4095)
==19390==    by 0x852D656: _ZL20exec_relay_log_eventP3THDP14Relay_log_info (slave.cc:2245)
==19390==    by 0x852E5D7: handle_slave_sql (slave.cc:3015)
==19390==    by 0x406650E: start_thread (in /lib/tls/i686/cmov/libpthread-2.8.90.so)
==19390==    by 0x42C8A0D: clone (in /lib/tls/i686/cmov/libc-2.8.90.so)

How to repeat:
./mtr --valgrind-mysqld rpl_binlog_corruption

Suggested fix:
=== modified file 'sql/log_event.cc'
--- sql/log_event.cc    2009-04-13 13:24:28 +0000
+++ sql/log_event.cc    2009-04-21 09:38:07 +0000
@@ -9269,7 +9269,7 @@
     // If the incident is not recognized, this binlog event is
     // invalid.  If we set incident_number to INCIDENT_NONE, the
     // invalidity will be detected by is_valid().
-    incident_number= INCIDENT_NONE;
+    m_incident= INCIDENT_NONE;
     DBUG_VOID_RETURN;
   }
   m_incident= static_cast<Incident>(incident_number);
[21 Apr 2009 10: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/72575

2861 Alfranio Correia	2009-04-21
      BUG#44378 rpl_binlog_corruption fails with warning messages in Valgrind
      
      The rpl_binlog_corruption test case was inject failures, specifically,
      incidents with invalid numbers to see if the replication was failing
      gracefully. However, this test was causing the following warning message
      in Valgrind: "Conditional jump or move depends on uninitialised value(s)"
      
      The patch fixes the problem by correctly initializing the m_inicident 
      number.
[5 May 2009 19:44] Bugs System
Pushed into 5.1.35 (revid:davi.arnaut@sun.com-20090505190206-9xmh7dlc6kom8exp) (version source revid:davi.arnaut@sun.com-20090505190206-9xmh7dlc6kom8exp) (merge vers: 5.1.35) (pib:6)
[6 May 2009 14:09] Bugs System
Pushed into 6.0.12-alpha (revid:svoj@sun.com-20090506125450-yokcmvqf2g7jhujq) (version source revid:alfranio.correia@sun.com-20090421143259-4c17kxqkosvqo7l5) (merge vers: 6.0.11-alpha) (pib:6)
[7 May 2009 13:27] Jon Stephens
No end-user changes to document; closed.
[15 Jun 2009 8:30] Bugs System
Pushed into 5.1.35-ndb-6.3.26 (revid:jonas@mysql.com-20090615074202-0r5r2jmi83tww6sf) (version source revid:jonas@mysql.com-20090615070837-9pccutgc7repvb4d) (merge vers: 5.1.35-ndb-6.3.26) (pib:6)
[15 Jun 2009 9:09] Bugs System
Pushed into 5.1.35-ndb-7.0.7 (revid:jonas@mysql.com-20090615074335-9hcltksp5cu5fucn) (version source revid:jonas@mysql.com-20090615072714-rmfkvrbbipd9r32c) (merge vers: 5.1.35-ndb-7.0.7) (pib:6)
[15 Jun 2009 9:50] Bugs System
Pushed into 5.1.35-ndb-6.2.19 (revid:jonas@mysql.com-20090615061520-sq7ds4yw299ggugm) (version source revid:jonas@mysql.com-20090615054654-ebgpz7elwu1xj36j) (merge vers: 5.1.35-ndb-6.2.19) (pib:6)