#33011 [Asn]: [PATCH] shmop: can still open segment for reading after shmop_delete
| From: | sfox@php.net | Date: | Wed, 18 Jul 2007 04:01:18 +0000 |
| Subject: | #33011 [Asn]: [PATCH] shmop: can still open segment for reading after shmop_delete | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-115213@lists.php.net to get a copy of this message | ||
ID: 33011
Updated by: sfox@php.net
Reported By: joe at bs0 dot com
Status: Assigned
Bug Type: Semaphore related
Operating System: win32 only
PHP Version: 5.0.4, 4.3.11
Assigned To: iliaa
New Comment:
Just noting two things: one, the patch is no longer online and two,
Ilia doesn't really 'do' Windows any more.
I looked at it but don't have time to play right now, not least because
I don't have a current copy of PHP on board. I _think_ it probably just
needs a flag setting in shmctl() (in tsrm_win32.c) when it's called from
shmop_delete() - not sure. Something like:
shm->descriptor->shm_perm.mode = IPC_EXCL;
- but again not sure, there's a copy flying around there somewhere. I'd
need to test.
Previous Comments:
------------------------------------------------------------------------
[2007-07-13 20:55:38] jmccaskey at gmail dot com
I'm experiencing this same issue on PHP 5.2.2 under Apache 2 on
windows. How is it that this issue was opened years ago and is not
fixed?
------------------------------------------------------------------------
[2006-04-15 16:43:52] piotrprz at gmail dot com
PHP 5.1.2 still has this bug: apache2/php5.1.2 on windows xp
------------------------------------------------------------------------
[2005-11-07 00:03:11] sniper@php.net
Ilia, have you checked the patch in this report yet?
------------------------------------------------------------------------
[2005-05-19 23:33:39] joe at bs0 dot com
patch: http://www.bs0.com/~joe/php/tsrm/tsrm_win32.diff
complete: http://www.bs0.com/~joe/php/tsrm/tsrm_win32.c
changes: http://www.bs0.com/~joe/php/tsrm/changes.txt
------------------------------------------------------------------------
[2005-05-15 02:34:02] joe at bs0 dot com
as short as I can make it:
<?php
$toWrite = 'test string';
$shm_len = strlen($toWrite);
$shm_id = shmop_open(0xff3, "c", 0644, $shm_len);
shmop_write($shm_id, $toWrite, 0);
shmop_close($shm_id);
$shm_id = shmop_open(0xff3, "a", 0, 0);
$data = shmop_read($shm_id, 0, $shm_len);
shmop_close($shm_id);
$shm_id = shmop_open(0xff3, "w", 0, 0);
if (!shmop_delete($shm_id)) {
echo "Couldn't mark shared memory block for deletion.<br/>";
}
else {
echo "shared memory block marked for deletion.<br/>";
}
shmop_close($shm_id);
echo 'block closed.<br/>';
$shm_id = shmop_open(0xff3, "a", 0, 0);
if($shm_id) {
$data = shmop_read($shm_id, 0, $shm_len);
shmop_close($shm_id);
echo 'ERROR: Previously deleted block able to be opened.<br/>';
echo 'Data read : "' . $data . '"';
}
else {
echo 'Could not open previously deleted block.<br/>';
}
?>
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/33011
--
Edit this bug report at http://bugs.php.net/?id=33011&edit=1