Bug #65949 [NEW]: memory leak and handle leak in shmop

From: Date: Wed, 23 Oct 2013 00:51:21 +0000
Subject: Bug #65949 [NEW]: memory leak and handle leak in shmop
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182398@lists.php.net to get a copy of this message
From: sakamoto dot ta at saxa dot co dot jp Operating system: Windows 2008 Server R2 PHP version: Irrelevant Package: Unknown/Other Function Bug Type: Bug Bug description:memory leak and handle leak in shmop Description: ------------ OS:Windows 2008 Server R2 PHP:Version 5.3.9 When I call the () shm_close the () shm_open, handle name \BaseNamedObjects\TSRM_SHM_DESCRIPTOR:x and \BaseNamedObjects\TSRM_SHM_SEGMENT:x remains without being released. The amount of memory used will continue to increase. This problem does not occur on Linux. Test script: --------------- <?php $shm_id = 0; $hex_shm_id = 0xff3; $write_d1 = "test #1 of the shmop() extension"; $write_d2 = "test #2 append data to shared memory segment"; for( ; ; ) { echo "shm open for create : "; $shm_id = shmop_open($hex_shm_id, "c", 0644, 1024); if (!$shm_id) { die("failed\n"); } else { echo "ok[".$shm_id."]\n"; } echo "shm size is: " . ($shm_size = shmop_size($shm_id)) . "\n"; echo "shm write test #1: "; $written = shmop_write($shm_id, $write_d1, 0); if ($written != strlen($write_d1)) { echo "failed\n"; } else { echo "ok\n"; } echo "data in memory is: " . shmop_read($shm_id, 0, $written) . "\n"; shmop_close($shm_id); $shm_id = 0; sleep(1); } ?> Expected result: ---------------- Memory leak and handle leak does not occur. -- Edit bug report at https://bugs.php.net/bug.php?id=65949&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65949&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=65949&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65949&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=65949&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=65949&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=65949&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=65949&r=needscript Try newer version: https://bugs.php.net/fix.php?id=65949&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=65949&r=support Expected behavior: https://bugs.php.net/fix.php?id=65949&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=65949&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=65949&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=65949&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65949&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=65949&r=dst IIS Stability: https://bugs.php.net/fix.php?id=65949&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=65949&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=65949&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=65949&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=65949&r=mysqlcfg

« previous php.bugs (#182398) next »