From: shigeru_kitazaki at cybozu dot co dot jp Operating system: Linux PHP version: 5.3.0 PHP Bug Type: ODBC related Bug description: Memory leak when fetching timestamp column from Oracle database
Description: ------------ PHP (debug build) detects memory leaks on this environment. - Linux Cent OS 5.3 (64bit) - unixODBC-2.2.15pre - Oracle instantclient 11.1 This occurs only when fetching Oracle "TIMESTANP" column on Linux. Reproduce code: --------------- <?php $dsn = "VALID_DATA_SOURCE_NAME"; $user = "VALID_USER_NAME"; $pass = "VALID_PASSWORD"; $conn = odbc_connect($dsn, $user, $pass); // sample table has this schema and has more than one row(s). // CREATE TABLE TEST (COLUMN1 TIMESTAMP) $ret = odbc_exec($conn, "SELECT COLUMN1 FROM TEST"); // Here detects leaking memory!! And, data seems normal state. $data = odbc_result($ret, 1); var_dump($data); odbc_close($conn); Actual result: -------------- string(26) "2009-11-13 00:00:00.000000" [Fri Nov 13 13:06:27 2009] Script: '/home/cybozu/oracle_timestamp.php' --------------------------------------- /home/cybozu/tmp/php/ext/odbc/php_odbc.c(429) : Block 0x04ae49a8 status: Beginning: OK (allocated on /home/cybozu/tmp/php/ext/odbc/php_odbc.c:984, 27 bytes) Start: OK End: Overflown (magic=0x00000030 instead of 0x6C71D1A1) 3 byte(s) overflown --------------------------------------- [Fri Nov 13 13:06:27 2009] Script: '/home/cybozu/oracle_timestamp.php' /home/cybozu/tmp/php/ext/odbc/php_odbc.c(984) : Freeing 0x04AE49A8 (27 bytes), script=/home/cybozu/oracle_timestamp.php === Total 1 memory leaks detected === -- Edit bug report at http://bugs.php.net/?id=50162&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50162&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50162&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50162&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=50162&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50162&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=50162&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=50162&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=50162&r=needscript Try newer version: http://bugs.php.net/fix.php?id=50162&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=50162&r=support Expected behavior: http://bugs.php.net/fix.php?id=50162&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=50162&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=50162&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=50162&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50162&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=50162&r=dst IIS Stability: http://bugs.php.net/fix.php?id=50162&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=50162&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=50162&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=50162&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=50162&r=mysqlcfg