Bug #20333 valgrind: mgmd event reporting dep on uninit value
Submitted: 8 Jun 2006 6:44 Modified: 21 Jun 2006 4:50
Reporter: Stewart Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:5.0.23 OS:
Assigned to: Stewart Smith CPU Architecture:Any

[8 Jun 2006 6:44] Stewart Smith
Description:
==29451== Conditional jump or move depends on uninitialised value(s)
==29451==    at 0x8094513: MgmtSrvr::handleReceivedSignal(NdbApiSignal*) (MgmtSrvr.cpp:1861)
==29451==    by 0x80945D3: MgmtSrvr::signalReceivedNotification(void*, NdbApiSignal*, LinearSectionPtr*) (MgmtSrvr.cpp:1917)
==29451==    by 0x80B3DBF: execute(void*, SignalHeader*, unsigned char, unsigned*, LinearSectionPtr*) (TransporterFacade.cpp:229)
==29451==    by 0x80DA799: TransporterRegistry::unpack(unsigned*, unsigned, unsigned short, IOState) (Packer.cpp:109)
==29451==    by 0x80D80B9: TransporterRegistry::performReceive() (TransporterRegistry.cpp:958)
==29451==    by 0x80B454F: TransporterFacade::threadMainReceive() (TransporterFacade.cpp:479)
==29451==    by 0x80B45DA: runReceiveResponse_C (TransporterFacade.cpp:464)
==29451==    by 0x80FBF9A: ndb_thread_wrapper (NdbThread.c:68)
==29451==    by 0x4044340: start_thread (in /lib/tls/i686/cmov/libpthread-2.3.6.so)
==29451==    by 0x429F4ED: clone (in /lib/tls/i686/cmov/libc-2.3.6.so)

How to repeat:
start mgmd,
run ndb_mgm -e 'show' in loop.
see valgrind warning.

Suggested fix:
===== ndb/src/mgmsrv/MgmtSrvr.cpp 1.99 vs edited =====
--- 1.99/ndb/src/mgmsrv/MgmtSrvr.cpp    2006-06-08 02:40:12 +10:00
+++ edited/ndb/src/mgmsrv/MgmtSrvr.cpp  2006-06-08 16:42:03 +10:00
@@ -1853,7 +1853,7 @@
     break;
   case GSN_EVENT_REP:
   {
-    EventReport *rep = CAST_PTR(EventReport, signal->getDataPtrSend());
+    EventReport *rep = (EventReport*) signal->getDataPtr();
     if (rep->getNodeId() == 0)
       rep->setNodeId(refToNode(signal->theSendersBlockRef));
     eventReport(signal->getDataPtr());
[19 Jun 2006 8:41] Tomas Ulin
patch as in suggested fix approved
[20 Jun 2006 7:35] 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/7897
[20 Jun 2006 9:09] Stewart Smith
pushed to 5.0.23

shouldn't really affect 5.1, but pushed to 5.1.12.
[21 Jun 2006 4:50] Paul Dubois
Noted in 5.0.23, 5.1.12 changelogs.
[2 Jul 2006 0:40] 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/7897