Bug #78538 [Ver->Csd]: shmop memory leak

From: Date: Fri, 03 Jan 2020 17:14:14 +0000
Subject: Bug #78538 [Ver->Csd]: shmop memory leak
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224695@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78538&edit=1 ID: 78538 Updated by: cmb@php.net Reported by: ptk2003 at gmail dot com Summary: shmop memory leak -Status: Verified +Status: Closed Type: Bug Package: *Extensibility Functions Operating System: Windows only PHP Version: 7.3.9 Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmbecker69@gmx.de Revision: http://git.php.net/?p=php-src.git;a=commit;h=18172303f41b9891ae4b78b0c6f70d0d47ed539f Log: Fix #78538: shmop memory leak Previous Comments: ------------------------------------------------------------------------ [2019-11-25 13:10:09] cmb@php.net The following pull request has been associated: Patch Name: Fix #78538: shmop memory leak On GitHub: https://github.com/php/php-src/pull/4944 Patch: https://github.com/php/php-src/pull/4944.patch ------------------------------------------------------------------------ [2019-09-15 11:03:31] ptk2003 at gmail dot com it possible to fix in current or future version? ------------------------------------------------------------------------ [2019-09-15 10:02:21] cmb@php.net This looks like a Windows only issue, and the culprit appears to be that we're not unmapping the shm->descriptor if it's no longer needed[1]. [1] <https://github.com/php/php-src/blob/php-7.3.9/TSRM/tsrm_win32.c#L731> ------------------------------------------------------------------------ [2019-09-14 20:05:40] ptk2003 at gmail dot com 4KB memory independent of the size of allocated memory in "c" or "n" open mode 1000 interations $shmophsw=shmop_open(0x4051, "c", 0777, 1); shmop_close($shmophsw); or shmop_open(0x4051, "c", 0777, 65536); give same result: httpd.exe increase 4MB working ram. shmop_delete() not change behaviour (and how use shmop if delete segment after create?) $shmophsw=shmop_open(0x4051, "a", 0, 0); give same behaviour: each add 4KB httpd.exe ------------------------------------------------------------------------ [2019-09-14 19:49:19] danack@php.net Can you give more indication of why you think this is classified as a memory leak, and not just normal memory usage for that extension? The code below isn't calling https://www.php.net/manual/en/function.shmop-delete.php to free the memory, so it's not too surprising some is resident. Also, 1000 * 65kb would be 65Mb if it was a memory leak. As you say it's only 4 MegaByte that sounds, like it's not leaking, just taking a bit more memory than you might expect. ------------------------------------------------------------------------ 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 https://bugs.php.net/bug.php?id=78538 -- Edit this bug report at https://bugs.php.net/bug.php?id=78538&edit=1

« previous php.bugs (#224695) next »