php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50162 Memory leak when fetching timestamp column from Oracle database
Submitted: 2009-11-13 04:33 UTC Modified: 2009-12-06 18:55 UTC
From: shigeru_kitazaki at cybozu dot co dot jp Assigned: felipe (profile)
Status: Closed Package: ODBC related
PHP Version: 5.3.0 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: shigeru_kitazaki at cybozu dot co dot jp
New email:
PHP Version: OS:

 

 [2009-11-13 04:33 UTC] 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 ===

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-06 18:53 UTC] 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-12-06 18:55 UTC] felipe@php.net
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.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC