471,083 Members | 1,207 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Valgrind warnings using a threaded C app


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

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
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 1548

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jerald | last post: by
reply views Thread by Sitsofe Wheeler | last post: by
2 posts views Thread by Andreas Andersen | last post: by
5 posts views Thread by Roman Mashak | last post: by
2 posts views Thread by Mohsen | last post: by
1 post views Thread by mfried | last post: by
4 posts views Thread by Simple Simon | last post: by
reply views Thread by Salvatore Iovene | last post: by

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.