Bug #79566 [Asn->Csd]: Private SHM is not private on Windows

From: Date: Tue, 05 May 2020 09:42:19 +0000
Subject: Bug #79566 [Asn->Csd]: Private SHM is not private on Windows
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226922@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
 Updated by:         cmb@php.net
 Reported by:        cmb@php.net
 Summary:            Private SHM is not private on Windows
-Status:             Assigned
+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:

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


Previous Comments:
------------------------------------------------------------------------
[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


Thread (4 messages)

« previous php.bugs (#226922) next »