Bug #12353 mysql ssl connection using mysql_real_connect and mysql_close cause memory leak
| Submitted: | 3 Aug 2005 18:03 | Modified: | 5 Aug 2005 2:18 |
|---|---|---|---|
| Reporter: | jimmy ta | Email Updates: | |
| Status: | Can't repeat | Impact on me: | |
| Category: | MySQL Server | Severity: | S1 (Critical) |
| Version: | 4.1.13 source | OS: | Windows (windows XP and unix) |
| Assigned to: | CPU Architecture: | Any |
[3 Aug 2005 18:03]
jimmy ta
[5 Aug 2005 2:18]
MySQL Verification Team
I tested your test case against Purify for Windows. There is a potentila
memory leak and the memory leak of 4 bytes in the function putenv
is for the use of VC++ 6.0 compiler, you can avoid that compiling
the server and client with VS 2003.
I just modified your test code removing the while(1) and the
user, password, database values.
c:\mysql\bin>mysql --ssl-ca=cacert.pem --ssl-cert=client-cert.pem --ssl-key=client-key.pem -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.13-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> SHOW VARIABLES LIKE 'have_openssl';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_openssl | YES |
+---------------+-------+
1 row in set (0.06 sec)
mysql>
START TEST
END TESTF CONNECTIONS MADE : 1
Press any key to continue...
[I] Starting Purify'd ssltest.exe at 04/08/2005 23:09:26
Instrumented executable: C:\Arquivos de programas\Rational\PurifyPlus\cache\ssltest$Purify_C_mysql_bin.exe
Working directory: C:\mysql\bin
Command line arguments: <none>
Process ID: 0x3fc
Thread ID: 0xb5c
[I] Starting main
[E] ABR: Array bounds read in my_xml_parse {1 occurrence}
Reading 4 bytes from 0x025c45dd (1 byte at 0x025c45e0 illegal)
Address 0x025c45dd is 17797 bytes into a 17800 byte block at 0x025c0058
Address 0x025c45dd points to a malloc'd block in heap 0x003e0000
Thread ID: 0xb5c
Error location
my_xml_parse [xml.obj]
my_parse_charset_xml [ssltest.exe]
get_collation_number [ssltest.exe]
get_collation_number [ssltest.exe]
get_charset_by_csname [ssltest.exe]
mysql_real_connect [ssltest.exe]
main [ssltest.cpp:48]
mainCRTStartup [printf.obj]
Allocation location
my_malloc [my_malloc.obj]
get_collation_number [ssltest.exe]
get_collation_number [ssltest.exe]
get_charset_by_csname [ssltest.exe]
mysql_real_connect [ssltest.exe]
main [ssltest.cpp:48]
mainCRTStartup [printf.obj]
[I] Summary of all memory leaks... {32 bytes, 2 blocks}
[I] MPK: Potential memory leak of 28 bytes from 1 block allocated in LdrLoadDll [NTDLL.dll]
Distribution of potentially leaked blocks
28 bytes from 1 block of 28 bytes (0x0015adc8)
Allocation location
HeapAlloc [KERNEL32.dll]
LdrLoadDll [NTDLL.dll]
LoadLibraryExA [kernel32.dll]
mysql_server_init [ssltest.exe]
mysql_init [ssltest.exe]
main [ssltest.cpp:35]
mainCRTStartup [printf.obj]
[W] MLK: Memory leak of 4 bytes from 1 block allocated in putenv [ssltest.exe]
Distribution of leaked blocks
4 bytes from 1 block of 4 bytes (0x003e6670)
Allocation location
_putenv_lk [putenv.obj]
putenv [putenv.obj]
setEnvString [ssltest.exe]
my_init [ssltest.exe]
mysql_server_init [ssltest.exe]
mysql_init [ssltest.exe]
main [ssltest.cpp:35]
mainCRTStartup [printf.obj]
[I] Exiting with code 0 (0x00000000)
Process time: 406 milliseconds
[I] Program terminated at 04/08/2005 23:10:20
[5 Aug 2005 23:48]
jimmy ta
I am compiling with gcc 3.4.1 on solaris and I notice the same problem. Can you suggest a version of gcc I can use on solaris.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.