Bug #14905 memory problems in the NDB engine found by valgrind
Submitted: 12 Nov 2005 23:12 Modified: 8 Apr 2006 9:03
Reporter: Oleksandr Byelkin Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:5.0.17 OS:Linux (linux)
Assigned to: Jonas Oreland CPU Architecture:Any

[12 Nov 2005 23:12] Oleksandr Byelkin
Description:
There a lot of valgrind errors like following:
==9249== Syscall param socketcall.send(msg) points to uninitialised byte(s)
==9249==    at 0x1BA8F5A8: send (in /lib/libpthread-0.10.so)
==9249==    by 0x8465C0D: TransporterRegistry::performSend() (TransporterRegistr
y.cpp:1082)
==9249==    by 0x84611D5: TransporterFacade::threadMainSend() (TransporterFacade
.cpp:447)
==9249==    by 0x8461140: runSendRequest_C (TransporterFacade.cpp:429)
==9249==    by 0x847A0A4: ndb_thread_wrapper (NdbThread.c:68)
==9249==    by 0x1BA87F1A: pthread_start_thread (in /lib/libpthread-0.10.so)
==9249==    by 0x1BBFDC09: clone (in /lib/libc-2.3.5.so)
==9249==  Address 0x1CF8D785 is 4221 bytes inside a block of size 262148 alloc'd
==9249==    at 0x1B901AB8: malloc (vg_replace_malloc.c:130)
==9249==    by 0x84E9B2C: operator new[](unsigned) (my_new.cc:33)
==9249==    by 0x848EA45: SendBuffer::initBuffer(unsigned) (SendBuffer.cpp:43)
==9249==    by 0x848E10C: TCP_Transporter::initTransporter() (TCP_Transporter.cp
p:148)
==9249==    by 0x8464E18: TransporterRegistry::createTCPTransporter(TransporterC
onfiguration*) (TransporterRegistry.cpp:316)
==9249==    by 0x84779A9: IPCConfig::configureTransporters(unsigned, ndb_mgm_con
figuration const&, TransporterRegistry&) (IPCConfig.cpp:351)
==9249==    by 0x8461677: TransporterFacade::init(unsigned, ndb_mgm_configuratio
n const*) (TransporterFacade.cpp:529)
==9249==    by 0x8460F77: TransporterFacade::start_instance(int, ndb_mgm_configuration const*) (TransporterFacade.cpp:368)
==9249==    by 0x8444917: Ndb_cluster_connection::connect(int, int, int) (ndb_cluster_connection.cpp:504)
==9249==    by 0x8293481: ndbcluster_init() (ha_ndbcluster.cc:4778)
==9249==    by 0x8266840: ha_init() (handler.cc:467)
==9249==    by 0x81A392F: init_server_components() (mysqld.cc:3032)
==9249==    by 0x81A3E02: main (mysqld.cc:3353)
==9249== Syscall param socketcall.send(msg) points to uninitialised byte(s)
==9249==    at 0x1BA8F5A8: send (in /lib/libpthread-0.10.so)
==9249==    by 0x8465C5D: TransporterRegistry::performSend() (TransporterRegistry.cpp:1091)
==9249==    by 0x84611D5: TransporterFacade::threadMainSend() (TransporterFacade.cpp:447)
==9249==    by 0x8461140: runSendRequest_C (TransporterFacade.cpp:429)
==9249==    by 0x847A0A4: ndb_thread_wrapper (NdbThread.c:68)
==9249==    by 0x1BA87F1A: pthread_start_thread (in /lib/libpthread-0.10.so)
==9249==    by 0x1BBFDC09: clone (in /lib/libc-2.3.5.so)
==9249==  Address 0x1CF8D7BD is 4277 bytes inside a block of size 262148 alloc'd
==9249==    at 0x1B901AB8: malloc (vg_replace_malloc.c:130)
==9249==    by 0x84E9B2C: operator new[](unsigned) (my_new.cc:33)
==9249==    by 0x848EA45: SendBuffer::initBuffer(unsigned) (SendBuffer.cpp:43)
==9249==    by 0x848E10C: TCP_Transporter::initTransporter() (TCP_Transporter.cpp:148)
==9249==    by 0x8464E18: TransporterRegistry::createTCPTransporter(TransporterConfiguration*) (TransporterRegistry.cpp:316)
==9249==    by 0x84779A9: IPCConfig::configureTransporters(unsigned, ndb_mgm_configuration const&, TransporterRegistry&) (IPCConfig.cpp:351)
==9249==    by 0x8461677: TransporterFacade::init(unsigned, ndb_mgm_configuration const*) (TransporterFacade.cpp:529)
==9249==    by 0x8460F77: TransporterFacade::start_instance(int, ndb_mgm_configuration const*) (TransporterFacade.cpp:368)
==9249==    by 0x8444917: Ndb_cluster_connection::connect(int, int, int) (ndb_cluster_connection.cpp:504)
==9249==    by 0x8293481: ndbcluster_init() (ha_ndbcluster.cc:4778)
==9249==    by 0x8266840: ha_init() (handler.cc:467)
==9249==    by 0x81A392F: init_server_components() (mysqld.cc:3032)
==9249==    by 0x81A3E02: main (mysqld.cc:3353)

How to repeat:
1) build last 5.0.17 with valgrind support,
2) run tests with valgrind, for example:
./mysql-test-run --valgrind func_group compress create
full list of failed test can be seen in master.err attached to the report.
[22 Nov 2005 0:06] Jorge del Conde
Tested under FC4 w/recent 5.0bk clone
[8 Apr 2006 9:51] Jonas Oreland
I cant reproduce after fixing #11033 (will push that that soon)