#43371 [Opn->Fbk]: Memory errors in PDO constructor
| From: | johannes@php.net | Date: | Mon, 15 Sep 2008 00:54:34 +0000 |
| Subject: | #43371 [Opn->Fbk]: Memory errors in PDO constructor | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-128969@lists.php.net to get a copy of this message | ||
ID: 43371
Updated by: johannes@php.net
Reported By: poletto at jeuxvideo dot com
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: Linux 2.4
PHP Version: 5.2.5
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.3-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.3-win32-installer-latest.msi
Previous Comments:
------------------------------------------------------------------------
[2008-07-03 17:02:17] uw@php.net
Can't reproduce with 5.3 CVS, PDO_MYSQLND and MySQL 5.0.51b-debug
Source distribution. No matter if I use mysqlnd or libmysql.
I haven't check PDO_MYSQL any more.
However, PDOs management of persistent connections seems to be not
perfect. I know of such an error:
done![Thu Jul 3 18:59:39 2008] Script:
'ext/pdo_mysqlnd/tests/pdo_mysql_pconnect.php'
/home/nixnutz/php53/ext/pdo/pdo_dbh.c(1514) : Freeing 0x06601898 (64
bytes), script=ext/pdo_mysqlnd/tests/pdo_mysql_pconnect.php
/home/nixnutz/php53/Zend/zend_alloc.c(2374) : Actual location (location
was relayed)
Last leak repeated 21 times
[Thu Jul 3 18:59:39 2008] Script:
'ext/pdo_mysqlnd/tests/pdo_mysql_pconnect.php'
/home/nixnutz/php53/ext/pdo/pdo_dbh.c(1513) : Freeing 0x06602910 (72
bytes), script=ext/pdo_mysqlnd/tests/pdo_mysql_pconnect.php
Last leak repeated 21 times
=== Total 44 memory leaks detected ===
==12737==
==12737== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from
0)
------------------------------------------------------------------------
[2007-11-22 17:09:20] poletto at jeuxvideo dot com
I can't try another version of mysql on this server.
I noticed there was no error when removing the persistant connection
------------------------------------------------------------------------
[2007-11-22 16:40:09] iliaa@php.net
It could be libmysqlclient related as you had suggested, can you try a
different version perhaps?
------------------------------------------------------------------------
[2007-11-22 15:20:11] poletto at jeuxvideo dot com
Same problem... Maybe a problem inside libmysqlclient?
> valgrind -q /usr/local/src/php5.3-200711221330/sapi/cli/php
test_pdo.php
==6951== Invalid read of size 4
==6951== at 0x40B29BD: my_strdup (in
/usr/local/MySQL-5.0.45/lib/libmysqlclient.so.15)
==6951== by 0x40D61D5: mysql_real_connect (in
/usr/local/MySQL-5.0.45/lib/libmysqlclient.so.15)
==6951== by 0x80F97AC: pdo_mysql_handle_factory
(mysql_driver.c:553)
==6951== by 0x80F0BE2: zim_PDO_dbh_constructor (pdo_dbh.c:372)
==6951== by 0x82380AA: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:191)
==6951== by 0x823790C: execute (zend_vm_execute.h:87)
==6951== by 0x822019C: zend_execute_scripts (zend.c:1139)
==6951== by 0x81E959B: php_execute_script (main.c:2008)
==6951== by 0x8280E39: main (php_cli.c:1140)
==6951== Address 0x470E900 is 8 bytes inside a block of size 9
alloc'd
==6951== at 0x401A826: malloc (vg_replace_malloc.c:149)
==6951== by 0x449A33F: strdup (in /lib/i686/libc-2.3.2.so)
==6951== by 0x80F0ABD: zim_PDO_dbh_constructor (pdo_dbh.c:358)
==6951== by 0x82380AA: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:191)
==6951== by 0x823790C: execute (zend_vm_execute.h:87)
==6951== by 0x822019C: zend_execute_scripts (zend.c:1139)
==6951== by 0x81E959B: php_execute_script (main.c:2008)
==6951== by 0x8280E39: main (php_cli.c:1140)
==6951==
==6951== Invalid read of size 4
==6951== at 0x40B1BC2: scramble (in
/usr/local/MySQL-5.0.45/lib/libmysqlclient.so.15)
==6951== by 0x40D654D: mysql_real_connect (in
/usr/local/MySQL-5.0.45/lib/libmysqlclient.so.15)
==6951== by 0x80F97AC: pdo_mysql_handle_factory
(mysql_driver.c:553)
==6951== by 0x80F0BE2: zim_PDO_dbh_constructor (pdo_dbh.c:372)
==6951== by 0x82380AA: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:191)
==6951== by 0x823790C: execute (zend_vm_execute.h:87)
==6951== by 0x822019C: zend_execute_scripts (zend.c:1139)
==6951== by 0x81E959B: php_execute_script (main.c:2008)
==6951== by 0x8280E39: main (php_cli.c:1140)
==6951== Address 0x470E900 is 8 bytes inside a block of size 9
alloc'd
==6951== at 0x401A826: malloc (vg_replace_malloc.c:149)
==6951== by 0x449A33F: strdup (in /lib/i686/libc-2.3.2.so)
==6951== by 0x80F0ABD: zim_PDO_dbh_constructor (pdo_dbh.c:358)
==6951== by 0x82380AA: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:191)
==6951== by 0x823790C: execute (zend_vm_execute.h:87)
==6951== by 0x822019C: zend_execute_scripts (zend.c:1139)
==6951== by 0x81E959B: php_execute_script (main.c:2008)
==6951== by 0x8280E39: main (php_cli.c:1140)
==6951==
==6951== Invalid read of size 4
==6951== at 0x40B15E1: scramble_323 (in
/usr/local/MySQL-5.0.45/lib/libmysqlclient.so.15)
==6951== by 0x40D66F3: mysql_real_connect (in
/usr/local/MySQL-5.0.45/lib/libmysqlclient.so.15)
==6951== by 0x80F97AC: pdo_mysql_handle_factory
(mysql_driver.c:553)
==6951== by 0x80F0BE2: zim_PDO_dbh_constructor (pdo_dbh.c:372)
==6951== by 0x82380AA: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:191)
==6951== by 0x823790C: execute (zend_vm_execute.h:87)
==6951== by 0x822019C: zend_execute_scripts (zend.c:1139)
==6951== by 0x81E959B: php_execute_script (main.c:2008)
==6951== by 0x8280E39: main (php_cli.c:1140)
==6951== Address 0x470E900 is 8 bytes inside a block of size 9
alloc'd
==6951== at 0x401A826: malloc (vg_replace_malloc.c:149)
==6951== by 0x449A33F: strdup (in /lib/i686/libc-2.3.2.so)
==6951== by 0x80F0ABD: zim_PDO_dbh_constructor (pdo_dbh.c:358)
==6951== by 0x82380AA: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:191)
==6951== by 0x823790C: execute (zend_vm_execute.h:87)
==6951== by 0x822019C: zend_execute_scripts (zend.c:1139)
==6951== by 0x81E959B: php_execute_script (main.c:2008)
==6951== by 0x8280E39: main (php_cli.c:1140)
------------------------------------------------------------------------
[2007-11-22 14:57:21] iliaa@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.3-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.3-win32-installer-latest.msi
I've tried to replicate the problem, but for me valgrind reports no
errors.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/43371
--
Edit this bug report at http://bugs.php.net/?id=43371&edit=1