ID: 25844 Updated by: [EMAIL PROTECTED] Reported By: jakub at icewarp dot com -Status: Open +Status: Bogus -Bug Type: Session related +Bug Type: IIS related Operating System: Windows (Any) PHP Version: 4.3.4RC1 New Comment:
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Because of this, we hope you add your comments to the existing bug instead. Thank you for your interest in PHP. See bug #23331 Previous Comments: ------------------------------------------------------------------------ [2003-10-12 06:53:27] jakub at icewarp dot com Description: ------------ This problem is hardly to be reproduced in CGI because the module is always released after finish. So the only way to reproduce it for me is the ISAPI module. You can use some web traffic tool and simulate a 1000 web accesses to any PHP script and see the memory of the ISAPI handler leaks. I'm using my own web server engine so I found out that 1000 hits to a simple <? phpinfo(); ?> page leaks about 700kb. I started debugging and compiling my own PHP core and found out this: Having the body of the funtion like this: DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) { return 0; } leaks no memory. So we proved it's not the web server engine that leaks (other ISAPI modules do not leak anyway). Using the most simple body like this: 2. 1. HttpExtensionProc like this does leak. DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) { TSRMLS_FETCH(); ts_free_thread(); return 0; } Leaks the memory as discussed above. So I kept digging more. Then I found the call that actually leaks the memory is: TSRM_SAFE_RETURN_RSRC(thread_resources->storage, id, thread_resources->count); In the function: TSRM_API void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id) The problem is with the return &array; Call which leaks the memory. If I remove it it does not leak. If I remove the pointer character it does not leak. So the question is why does the return call leak when passing back the pointer? I'm not a C++ guru so I can't make this out. I had to post it here because when I posted the problem to ISAPI section nobody cared. This problem has been there for the last 2 years for sure. The leak is 100% reproducable and the question is why wouldn't it leak on Linux.... Please help us here? Thank you Jakub ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25844&edit=1