|
From: Diego T. <dt...@co...> - 2003-12-26 04:59:09
|
Working with valgrind (2.1.0, under debian) with a little test program shows the following problem:
# valgrind ./tests_mysql
==31011== Memcheck, a memory error detector for x86-linux.
==31011== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward.
==31011== Using valgrind-2.1.0, a program supervision framework for x86-linux.
==31011== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward.
==31011== Estimated CPU clock rate is 1335 MHz
==31011== For more details, rerun with: -v
==31011==
==31011== Invalid read of size 1
==31011== at 0x40385546: __GI__dl_close (dl-close.c:122)
==31011== by 0x403863CA: do_dlclose (dl-libc.c:96)
==31011== by 0x4000BF15: _dl_catch_error (in /lib/ld-2.3.2.so)
==31011== by 0x4038630D: dlerror_run (dl-libc.c:42)
==31011== Address 0x1E7 is not stack'd, malloc'd or free'd
==31011==
==31011== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==31011== Address not mapped to object at address 0x1E7
==31011== at 0x40385546: __GI__dl_close (dl-close.c:122)
==31011== by 0x403863CA: do_dlclose (dl-libc.c:96)
==31011== by 0x4000BF15: _dl_catch_error (in /lib/ld-2.3.2.so)
==31011== by 0x4038630D: dlerror_run (dl-libc.c:42)
==31011==
==31011== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 1)
==31011== malloc/free: in use at exit: 1876 bytes in 9 blocks.
==31011== malloc/free: 44 allocs, 35 frees, 4119 bytes allocated.
==31011== For a detailed leak analysis, rerun with: --leak-check=yes
==31011== For counts of detected errors, rerun with: -v
Segmentation fault
The test program is the following:
# cat tests_mysql.c
#include <mysql/mysql.h>
int main(int argc, char *argv[]) {
MYSQL * mysql_dbh;
mysql_dbh = mysql_init(0);
mysql_close(mysql_dbh);
return 0;
}
and it is compiled like:
# gcc -lmysqlclient -o tests_mysql tests_mysql.c
more info:
# ldd tests_mysql
libmysqlclient.so.12 => /usr/lib/libmysqlclient.so.12 (0x4001e000)
libc.so.6 => /lib/libc.so.6 (0x4005e000)
libz.so.1 => /lib/libz.so.1 (0x40190000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x4019e000)
libnsl.so.1 => /lib/libnsl.so.1 (0x401cb000)
libm.so.6 => /lib/libm.so.6 (0x401e0000)
libssl.so.0.9.7 => /usr/lib/i686/cmov/libssl.so.0.9.7 (0x40202000)
libcrypto.so.0.9.7 => /usr/lib/i686/cmov/libcrypto.so.0.9.7 (0x40231000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
libdl.so.2 => /lib/libdl.so.2 (0x40322000)
pool/main/v/valgrind/valgrind_2.1.0-1_i386.deb
pool/main/m/mysql-dfsg/libmysqlclient12_4.0.16-2_i386.deb
The same error happens with libmysqlclient10. I haven't found any info about
problems between mysql and valgrind, so maybe it's a valgrind bug or a
mysqlclient bug? does anyone have answers to this? :)
Thanks in advance!
--
-- gnupg keyfingerprint -- 48AF 5BF9 8F54 2966 64CC 2327 7CD0 DD91 B09D 5799
-- Use of a keyboard or mouse may be linked to serious injuries or disorders.
Diego Torres - dtorres at anthalia dot org - Madrid / España
|