#50162 [Opn->Csd]: Memory leak when fetching timestamp column from Oracle database
| From: | felipe@php.net | Date: | Sun, 06 Dec 2009 18:55:22 +0000 |
| Subject: | #50162 [Opn->Csd]: Memory leak when fetching timestamp column from Oracle database | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-145455@lists.php.net to get a copy of this message | ||
ID: 50162
Updated by: felipe@php.net
Reported By: shigeru_kitazaki at cybozu dot co dot jp
-Status: Open
+Status: Closed
Bug Type: ODBC related
Operating System: Linux
PHP Version: 5.3.0
-Assigned To:
+Assigned To: felipe
New Comment:
This bug has been fixed in SVN.
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.
This is an Oracle odbc driver issue, look:
http://www.tech-archive.net/Archive/Data/microsoft.public.data.odbc/2006-08/msg00033.html
However I added a workaround for this issue.
Previous Comments:
------------------------------------------------------------------------
[2009-12-06 18:53:16] svn@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=291772
Log: - Fixed bug #50162 (Memory leak when fetching timestamp column
from Oracle database)
- Fixed bug #34852 (Failure in odbc_exec() using oracle-supplied odbc
driver) (patch by tim dot tassonis at trivadis dot com)
------------------------------------------------------------------------
[2009-11-13 04:33:28] shigeru_kitazaki at cybozu dot co dot jp
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 this bug report at http://bugs.php.net/?id=50162&edit=1