php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37194 HTTP memory increased
Submitted: 2006-04-25 09:14 UTC Modified: 2006-07-30 01:00 UTC
From: ysuzuki at zend dot co dot jp Assigned:
Status: No Feedback Package: Informix related
PHP Version: 4.4.2 OS: RedHat Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-04-25 09:14 UTC] ysuzuki at zend dot co dot jp
Description:
------------
Our developers created a sample code by using the following functions.

--- ifx_connect(), ifx_query(), ifx_free_result(), ifx_close()

This sample program is very simple such as connect to Infomix DB and then issue some query string, get query result, and finally disconnect Informix DB. They executed this sample php code several times. Then, they found a problem that HTTPD used memory was increased. This is kind of memory leak problem.

They also investigated php_initfx_count_descriptors() function.

 

static php_initfx_count_descriptors(char *p_statemid TSRMLS_DC)
{
      EXEC SQL BEGIN DECLARE SECTION;
      char *statemid = p_statemid;
      EXEC SQL END DECLARE SECTION;

      struct sqlda *s_da;
      int ret = 384;
  
      EXEC SQL DESCRIBE :statemid INTO s_da;
 
      If(ifx_check()) >= 0)   {
           ret = s_da->sqlid;
           /*
*Thanks to DBD-Informix
*/
#if (ESQLC_VERSION >= 720 || (ESQLC_VERSION >= 501 && ESQLC_VERSION < 600))
        SqlFreeMem(s_da, SQLDA_FREE);
      } else {
            free(s_da);
#endif
      }

      return ret;
}



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-26 02:14 UTC] ysuzuki at zend dot co dot jp
If it?s not match condition as follows, it will never free Informix memory, I think.

(ESQLC_VERSION >= 720 || (ESQLC_VERSION >= 501 && ESQLC_VERSION < 600)

I changed this portion is the following. After that, This problem was fixed. I believe this modification is right code. Please take it.

#if (ESQLC_VERSION >= 720 || (ESQLC_VERSION >= 501 && ESQLC_VERSION < 600))
        SqlFreeMem(s_da, SQLDA_FREE);
      } else {
#else
            free(s_da);
#endif
 [2006-04-27 03:34 UTC] ysuzuki at zend dot co dot jp
Sorry, Bug fixed right code is here.

#if (ESQLC_VERSION >= 720 || (ESQLC_VERSION >= 501 && ESQLC_VERSION <
600))
        SqlFreeMem(s_da, SQLDA_FREE);
#else <-- *** I added this line ***
        free(s_da);
#endif
 [2006-07-22 12:17 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-07-30 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 14:01:31 2024 UTC