Bug #79566 [Com]: Private SHM is not private on Windows
| From: | albertareed1988 at gmail dot com | Date: | Mon, 01 Feb 2021 09:58:49 +0000 |
| Subject: | Bug #79566 [Com]: Private SHM is not private on Windows | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-231854@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79566&edit=1
ID: 79566
Comment by: albertareed1988 at gmail dot com
Reported by: cmb@php.net
Summary: Private SHM is not private on Windows
Status: Closed
Type: Bug
Package: *Extensibility Functions
Operating System: Windows only
PHP Version: 7.3Git-2020-05-05 (Git)
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Thanks for the info i will try to figure it out for more
https://www.myaarpmedicare.rocks/
Previous Comments:
------------------------------------------------------------------------
[2020-05-05 09:42:19] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f33cf52faf733f5a6441a533f83e9b1cf2018245
Log: Fix #79566: Private SHM is not private on Windows
------------------------------------------------------------------------
[2020-05-05 09:35:25] cmb@php.net
The following pull request has been associated:
Patch Name: Support shmget(IPC_PRIVATE, â¦) on Windows
On GitHub: https://github.com/php/php-src/pull/5519
Patch: https://github.com/php/php-src/pull/5519.patch
------------------------------------------------------------------------
[2020-05-05 09:31:21] cmb@php.net
Description:
------------
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] <https://github.com/krakjoe/apcu/issues/394>
Test script:
---------------
<?php
$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);
shmop_close($shm1);
shmop_close($shm2);
?>
Expected result:
----------------
bool(true)
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79566&edit=1