#23331 [Opn->Fbk]: Memory leak in ISAPI

From: Date: Sun, 04 May 2003 08:30:46 +0000
Subject: #23331 [Opn->Fbk]: Memory leak in ISAPI
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-39013@lists.php.net to get a copy of this message
 ID:               23331
 Updated by:       wez@php.net
 Reported By:      jakub at icewarp dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         IIS related
 Operating System: W2K
 PHP Version:      4.3.2RC1
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip




Previous Comments:
------------------------------------------------------------------------

[2003-05-03 10:22:59] jakub at icewarp dot com

I was wrong about the _DllMain@12 it is called by Windows
automatically. However I have found for instance this.
If you load the ISAPI module and free it in a cycle again it does not
free the memory.
for ($i=0;$i<1000;$i++)
{
  lh = loadlibrary("...isapi.dll");
  freelibrary(lh);
}
After 200 cycles the process consumes 50MB. I don't think that should
happen. What is wrong?

------------------------------------------------------------------------

[2003-05-03 04:02:26] jakub at icewarp dot com

Some more info I have found.
The DllMain function from the ISAPI dll is incorrectly exported and has
the name _DllMain@12 so it cannot be called by the web server. When you
call the PROCESS_ATTACH and DETACH DllMain calls it raises and
exception. THREAD_ATTACH and DETACH work fine but still the memory leak
is there. Each call to the HttpExtensionProc leaks about 1kB of memory.
Please try to have a look at it
J

------------------------------------------------------------------------

[2003-05-02 08:44:36] jakub at icewarp dot com

I have found out there is a worse problem. When calling the 
ISAPI DLL function HttpExtensionProc(Extension) to process the PHP
session it leaks some memory. If you remove the call it does not leak
any memory. I also made sure the WriteClientProc and such procedures in
the Extension struct are empty so there could not be any leak from
within the web server engine. I also tried to unload the ISAPI dll and
this did not free the memory either. When run the 1000x
HttpExtensionProc(Extension) to a very easy script like the following:
<?
  echo "Hello";
?>
It leaks about 500kB. I'm not a Linux guy but I suppose if there would
be a leak on Linux everybody would already know so I think it might be
the ISAPI module problem only. Hopefully.
Thanks Jakub

------------------------------------------------------------------------

[2003-04-29 10:21:22] sniper@php.net

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.



------------------------------------------------------------------------

[2003-04-24 12:38:03] sniper@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip



------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/23331

-- 
Edit this bug report at http://bugs.php.net/?id=23331&edit=1



Thread (23 messages)

« previous php.bugs (#39013) next »