From: hszheng at gmail dot com Operating system: windows2003, windowsxp PHP version: 5.2.9RC1 PHP Bug Type: Reproducible crash Bug description: shmop_open memory leak cause apache crash
Description: ------------ php version 5.2.6 Build Date May 2 2008 18:01:20 PHP API 20041225 PHP Extension 20060613 Zend Extension 220060519 Apache/2.2.8 (Win32) PHP/5.2.6 Apache API Version 20051115 Request URL http://host/file1.php Request URL http://host/file2.php and refresh several times. windows alert that httpd.exe - application error. notice a memory address can not be "read". In Task manager during the operation, the process httpd.exe memory usage increment quickly, and then crashed. Reproduce code: --------------- file1.php -------------------------- <?php $int_shm = shmop_open(20000, 'c', 0600, 2048); shmop_write($int_shm, 'abcd', 0); shmop_close($int_shm); echo "OK"; ?> file2.php -------------------------- <?php for($i = 0; $i < 10000; $i ++){ $int_shm = shmop_open(20000, 'a', 0, 0); $str_data = trim(shmop_read($int_shm, 0, 100)); shmop_close($int_shm); } echo $str_data; echo "Done.<br />"; ?> Expected result: ---------------- Warning: shmop_open() [function.shmop-open]: unable to attach or create shared memory segment in F:\home\share_var2.php on line 3 Warning: shmop_read() [function.shmop-read]: no shared memory segment with an id of [0] in F:\home\share_var2.php on line 4 Warning: shmop_close() [function.shmop-close]: no shared memory segment with an id of [0] in F:\home\share_var2.php on line 5 -- Edit bug report at http://bugs.php.net/?id=47328&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47328&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47328&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47328&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=47328&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47328&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=47328&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=47328&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=47328&r=needscript Try newer version: http://bugs.php.net/fix.php?id=47328&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=47328&r=support Expected behavior: http://bugs.php.net/fix.php?id=47328&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=47328&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=47328&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=47328&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47328&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=47328&r=dst IIS Stability: http://bugs.php.net/fix.php?id=47328&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=47328&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=47328&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=47328&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=47328&r=mysqlcfg