|  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [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: Fri Dec 08 10:01:28 2023 UTC