473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Valgrind warnings using a threaded C app

Hello,

I am using a threaded C program and each thread creates its own
connection to mysql database using mysql_init(). When I run Valgrind on
the program it reports that there has been a small leak stemming from
several mysql_init and one mysql_real_connect. I have read
http://www.mysql.com/doc/en/Threaded_clients.html but despite adding
my_thread_init(), my_thread_end() and linking against mysqlclient_r a
leak is still reported. Here is some of the output valgrind produces:

==10028== 23 bytes in 1 blocks are still reachable in loss record 1 of 13
==10028== at 0x40166BC0: malloc (vg_clientfuncs.c:103)
==10028== by 0x40008C2B: _dl_new_object (in /lib/ld-2.2.5.so)
==10028== by 0x400049EE: _dl_map_object_from_fd (in /lib/ld-2.2.5.so)
==10028== by 0x40005DB6: _dl_map_object_internal (in /lib/ld-2.2.5.so)
==10028== by 0x42112307: dl_open_worker (in /lib/i686/libc-2.2.5.so)
==10028== by 0x4000B4B2: _dl_catch_error_internal (in /lib/ld-2.2.5.so)
==10028== by 0x421128E0: _dl_open (in /lib/i686/libc-2.2.5.so)
==10028== by 0x42113610: do_dlopen (in /lib/i686/libc-2.2.5.so)
==10028== by 0x4000B4B2: _dl_catch_error_internal (in /lib/ld-2.2.5.so)
==10028== by 0x421134BB: __libc_dlopen (in /lib/i686/libc-2.2.5.so)
==10028== by 0x420F52C6: __nss_lookup_function (in /lib/i686/libc-2.2.5.so)
==10028== by 0x420F5B95: __nss_lookup (in /lib/i686/libc-2.2.5.so)
==10028== by 0x420F6A5E: __nss_services_lookup (in /lib/i686/libc-2.2.5.so)
==10028== by 0x420FA180: getservbyname_r@@GLIBC_2.1.2 (in /lib/i686/libc-2.2.5.so)
==10028== by 0x420F9F7E: getservbyname (in /lib/i686/libc-2.2.5.so)
==10028== by 0x4035DFA5: mysql_once_init (in /usr/lib/mysql/libmysqlclient_r.so.10.0.0)
==10028== by 0x4035DEBB: mysql_init (in /usr/lib/mysql/libmysqlclient_r.so.10.0.0)
....

Is this report spurious? If not what am I doing wrong to cause this
leak?

I am running "mysql Ver 11.18 Distrib 3.23.56, for pc-linux (i686)" on
RedHat 7.3. If I have the wrong list, please point me toward the correct
one!
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1643

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jerald | last post by:
Running python 2.3.4 on valgrind (a tool like purify which checks the use of uninitialized memory, etc), gives a lot of errors. See below. jfj@cluster:~/> python -V Python 2.3.4...
0
by: Sitsofe Wheeler | last post by:
Hello, I am using a threaded C program and each thread creates its own connection to mysql database using mysql_init(). When I run Valgrind on the program it reports that there has been a small...
2
by: Andreas Andersen | last post by:
Hi I have been using valgrind to debug a program I have written in C++ and it has been very helpful in eliminating memory errors/leaks. However, I just recently discovered a bug and from what I...
2
by: hvaisane | last post by:
Valgrind says ==11604== Invalid read of size 4 ==11604== at 0x8048ABB: main (foo.cc:36) ==11604== Address 0x1B92415C is 4 bytes inside a block of size 8 free'd ==11604== at 0x1B90514F:...
5
by: Roman Mashak | last post by:
Hello, All! I already posted my question and received valuable feedbacks, I changed my code as was proposed here but still receive the same error of valgrind. SO, the code is: #define...
1
by: Nathan Bates | last post by:
Are the Python developers running Python under Valgrind? If not, FYI, Valgrind is a excellent memory-checker for Linux. Valgrind is reporting a ton of memory problems. Worrisome are "Conditional...
2
by: Mohsen | last post by:
Dear all, I am running a program and in one of the functions I have to sort the data of an array as follows: .. .. .. for (m=0;m<M;++m) //Sort { k=m; for (j=m+1;j<M;++j)
1
by: mfried | last post by:
Hi all, I'm testing an application using valgrind 3.2.0 unter Linux kernel 2.4. When the test are finished and the app terminates valgrind gives the error: --15631:0:aspacem Valgrind: FATAL:...
4
by: Simple Simon | last post by:
It's entirely possible that I'm completely in the wrong line of work, but I don't see what Valgrind is complaining about in this code. Invalid read/writes? If I free the within main(), rather...
0
by: Salvatore Iovene | last post by:
Hi, I'm using the pexpect module to spawn some processes in a testing environment. pexpect uses, internally, os.execv. What I need to do is valgrind python and get memory leaks from the spawned...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.