|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47429 Memory leak using shmop_open
Submitted: 2009-02-17 22:58 UTC Modified: 2012-08-10 14:22 UTC
Avg. Score:3.8 ± 1.6
Reproduced:3 of 4 (75.0%)
Same Version:2 (66.7%)
Same OS:3 (100.0%)
From: iv dot zhekov at gmail dot com Assigned:
Status: Not a bug Package: Semaphore related
PHP Version: 5.2CVS-2009-02-17 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
10 + 17 = ?
Subscribe to this entry?

 [2009-02-17 22:58 UTC] iv dot zhekov at gmail dot com
Function shmop_open increases memory used by Apache with about 4KB every time it is invoked, and doesn't free it. It looks like memory allocated for php_shmop struct is not freed.

Reproduce code:
$shmid = shmop_open(0xff2, "c", 0644, 8);

Expected result:
Memory used by apache should be increased only once, when shared memory segment is created. Refreshing the page should not increase used memory or it must free it when script ends.

Actual result:
Every time the script is executed additional 4KB are added to the memory used by Apache.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-18 09:16 UTC] iv dot zhekov at gmail dot com
Still reproduced using latest snapshot.
 [2010-08-26 00:08 UTC]
-Status: Open +Status: Feedback
 [2010-08-26 00:08 UTC]
Please try using this snapshot:
For Windows:

 [2011-02-25 11:41 UTC] giezer at eu dot objectiflune dot com
Tested this with 5.2.17 and I can still reproduce this problem it isn't fixed.
 [2012-08-10 14:22 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

 [2012-08-10 14:22 UTC]
-Status: Feedback +Status: Not a bug
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Aug 08 13:05:46 2022 UTC