|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79566 Private SHM is not private on Windows
Submitted: 2020-05-05 09:31 UTC Modified: 2020-05-05 09:34 UTC
From: Assigned: cmb (profile)
Status: Closed Package: *Extensibility Functions
PHP Version: 7.3Git-2020-05-05 (Git) OS: Windows only
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:
43 + 34 = ?
Subscribe to this entry?

 [2020-05-05 09:31 UTC]
Calling shmop_open() with a $key that matches IPC_PRIVATE (which
is usually zero on POSIX, and always zero on Windows), creates
private shared memory on POSIX, but not on Windows.

This is actually not particularly related to ext/shmop, but rather
to our Windows emulation layer for XSI shared memory (shmget() and
friends), so all extensions which use that functionality to create
private SHM are affected by this.  For instance, APCu[1].

[1] <>

Test script:
$write = 'test';

$shm1 = shmop_open(0, 'c', 0777, 1024);
shmop_write($shm1, $write, 0);

$shm2 = shmop_open(0, 'c', 0777, 1024);
$read = shmop_read($shm2, 0, 4);

var_dump(is_string($read) && $read !== $write);


Expected result:

Actual result:


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-05 09:34 UTC]
-Assigned To: +Assigned To: cmb
 [2020-05-05 09:35 UTC]
The following pull request has been associated:

Patch Name: Support shmget(IPC_PRIVATE, …) on Windows
On GitHub:
 [2020-05-05 09:42 UTC]
Automatic comment on behalf of
Log: Fix #79566: Private SHM is not private on Windows
 [2020-05-05 09:42 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Dec 06 08:01:31 2023 UTC