ID: 45432 Updated by: fel...@php.net Reported By: uwendel at mysql dot com -Status: Verified +Status: Closed Bug Type: PDO related Operating System: Linux 64bit PHP Version: 5.3CVS-2008-07-04 (CVS) -Assigned To: +Assigned To: felipe New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2008-10-29 23:38:09] fel...@php.net That is related to #43831, the cached dbh have your data changed disregarding the dbh->ce, and the alloced 'properties' isn't freed. ------------------------------------------------------------------------ [2008-07-04 17:39:22] uwendel at mysql dot com Description: ------------ Creating a persistent connection handle and assigning a new persistent connection to the same handle (variable) causes a leak. $db = new PDO(...) $db = new PDO(...) <--- leak My PHP 5.3 CVS snapshot is a little older than 04.07.2008, anyway. nixn...@ulflinux:~/php53> sapi/cli/php -v PHP 5.3.0-dev (cli) (built: Jul 3 2008 16:20:01) (DEBUG) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2008 Zend Technologies Reproduce code: --------------- nixn...@ulflinux:~/php53> valgrind sapi/cli/php -r '$db = new PDO("sqlite:/tmp/foo", NULL, NULL, array(PDO::ATTR_PERSISTENT => true)); $db = new PDO("sqlite:/tmp/foo", NULL, NULL, array(PDO::ATTR_PERSISTENT => true));' ==32328== Memcheck, a memory error detector. ==32328== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al. ==32328== Using LibVEX rev 1804, a library for dynamic binary translation. ==32328== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP. ==32328== Using valgrind-3.3.0, a dynamic binary instrumentation framework. ==32328== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al. ==32328== For more details, rerun with: -v [Fri Jul 4 19:35:02 2008] Script: '-' /home/nixnutz/php53/ext/pdo/pdo_dbh.c(1513) : Freeing 0x0655C3C8 (72 bytes), script=- [Fri Jul 4 19:35:02 2008] Script: '-' /home/nixnutz/php53/ext/pdo/pdo_dbh.c(1514) : Freeing 0x0655C468 (64 bytes), script=- /home/nixnutz/php53/Zend/zend_alloc.c(2374) : Actual location (location was relayed) === Total 2 memory leaks detected === ==32328== ==32328== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0) ==32328== malloc/free: in use at exit: 91,869 bytes in 137 blocks. ==32328== malloc/free: 11,910 allocs, 11,773 frees, 3,125,629 bytes allocated. ==32328== For counts of detected errors, rerun with: -v ==32328== searching for pointers to 137 not-freed blocks. ==32328== checked 558,296 bytes. ==32328== ==32328== LEAK SUMMARY: ==32328== definitely lost: 11,325 bytes in 128 blocks. ==32328== possibly lost: 456 bytes in 6 blocks. ==32328== still reachable: 80,088 bytes in 3 blocks. ==32328== suppressed: 0 bytes in 0 blocks. ==32328== Rerun with --leak-check=full to see details of leaked memory. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45432&edit=1