Bug #79566 [NEW]: Private SHM is not private on Windows
From: cmb
Operating system: Windows only
PHP version: 7.3Git-2020-05-05 (Git)
Package: *Extensibility Functions
Bug Type: Bug
Bug description:Private SHM is not private on Windows
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 bug report at https://bugs.php.net/bug.php?id=79566&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79566&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79566&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79566&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79566&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79566&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79566&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79566&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79566&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79566&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79566&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79566&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79566&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79566&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79566&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79566&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79566&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79566&r=mysqlcfg
Thread (4 messages)
- cmb@php.net