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/[EMAIL PROTECTED]