Bug #11036 Valgrind warning "Syscall param socketcall.send(msg) ..."
Submitted: 2 Jun 2005 13:27 Modified: 7 Apr 2006 12:30
Reporter: Magnus Blåudd Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:5.0.7 OS:
Assigned to: CPU Architecture:Any

[2 Jun 2005 13:27] Magnus Blåudd
Description:
Valgrind reports that TransporterRegistry::performSend passes unintialized data to send(). ie. send of uninited data to a socket.

The best trick tol find these kind of problems is to turn on signal logging in NdbApi, since then every signal will be printed and thus thouched so that valgrind can detect where in the code problem occurs. However in this case it does not pass through signaLogger and it can thus not be easily located.

==15225== 97 errors in context 13 of 29:
==15225== Thread 10:
==15225== Syscall param socketcall.send(msg) points to uninitialised byte(s)
==15225==    at 0xDDA888: send (in /lib/tls/libpthread-2.3.5.so)
==15225==    by 0x8473ED5: TransporterRegistry::performSend() (TransporterRegistry.cpp:1061)
==15225==    by 0x844B7AD: TransporterFacade::threadMainSend() (TransporterFacade.cpp:430)
==15225==    by 0x844B718: runSendRequest_C (TransporterFacade.cpp:412)
==15225==    by 0x848CFF6: ndb_thread_wrapper (NdbThread.c:58)
==15225==    by 0xDD5340: start_thread (in /lib/tls/libpthread-2.3.5.so)
==15225==    by 0xBD7FED: clone (in /lib/tls/libc-2.3.5.so)
==15225==  Address 0x1CC41B81 is 649 bytes inside a block of size 262148 alloc'd==15225==    at 0x1B905222: malloc (vg_replace_malloc.c:130)
==15225==    by 0x84F9488: operator new[](unsigned) (my_new.cc:33)
==15225==    by 0x84A1E29: SendBuffer::initBuffer(unsigned) (SendBuffer.cpp:43)
==15225==    by 0x84767DC: TCP_Transporter::initTransporter() (TCP_Transporter.cpp:148)
==15225==    by 0x8473108: TransporterRegistry::createTCPTransporter(TransporterConfiguration*) (TransporterRegistry.cpp:302)
==15225==    by 0x848AA57: IPCConfig::configureTransporters(unsigned, ndb_mgm_configuration const&, TransporterRegistry&) (IPCConfig.cpp:357)
==15225==    by 0x844BB61: TransporterFacade::init(unsigned, ndb_mgm_configuration const*) (TransporterFacade.cpp:506)
==15225==    by 0x844B541: TransporterFacade::start_instance(int, ndb_mgm_configuration const*) (TransporterFacade.cpp:349)
==15225==    by 0x8452FE7: Ndb_cluster_connection::connect(int, int, int) (ndb_cluster_connection.cpp:504)
==15225==    by 0x827E915: ndbcluster_init() (ha_ndbcluster.cc:4770)
==15225==    by 0x8251A03: ha_init() (handler.cc:405)
==15225==    by 0x8196E13: init_server_components() (mysqld.cc:2810)
==15225==    by 0x8197368: main (mysqld.cc:3115)
==15225==
==15225== 97 errors in context 14 of 29:
==15225== Syscall param socketcall.send(msg) points to uninitialised byte(s)
==15225==    at 0xDDA888: send (in /lib/tls/libpthread-2.3.5.so)
==15225==    by 0x8473E85: TransporterRegistry::performSend() (TransporterRegistry.cpp:1052)
==15225==    by 0x844B7AD: TransporterFacade::threadMainSend() (TransporterFacade.cpp:430)
==15225==    by 0x844B718: runSendRequest_C (TransporterFacade.cpp:412)
==15225==    by 0x848CFF6: ndb_thread_wrapper (NdbThread.c:58)
==15225==    by 0xDD5340: start_thread (in /lib/tls/libpthread-2.3.5.so)
==15225==    by 0xBD7FED: clone (in /lib/tls/libc-2.3.5.so)
==15225==  Address 0x1CC43DC9 is 9425 bytes inside a block of size 262148 alloc'd

How to repeat:
./mysql-test-run --do-test=ndb_basic --valgrind

Suggested fix:
Make sure all data sent to socket are passed through signalLogger and thus printed to signal log. In that way it's relatively easy to locate and fix problem.
[7 Apr 2006 12:30] Jonas Oreland
rerun against 5.0.21 (amd64)
could not reproduce