ID: 33011 User updated by: joe at bs0 dot com Reported By: joe at bs0 dot com -Status: Bogus +Status: Open Bug Type: Semaphore related Operating System: windows xp PHP Version: 5.0.4, 4.3.11 New Comment:
no, php has a layer over the win32 api that provides an interface identical to the posix shm api. please see TSRM/tsrm_win32.c. The problem lies in this code, not in the windows code base. I have code working that fixes this problem, can you tell me how I can submit a patch/ if there is anyone that could do a code review? Thanks Previous Comments: ------------------------------------------------------------------------ [2005-05-18 12:40:52] [EMAIL PROTECTED] Bug Micro$oft about it. If it works on *nix and doesn't work on Windows, than it's definitely not a PHP problem, because PHP uses the same code in ext/shmop for all OSes. ------------------------------------------------------------------------ [2005-05-16 14:35:16] joe at bs0 dot com you are testing this under windows? ------------------------------------------------------------------------ [2005-05-16 12:24:09] [EMAIL PROTECTED] This code outputs for me: shared memory block marked for deletion. block closed. PHP Warning: shmop_open(): unable to attach or create shared memory segment in /www/index.php on line 27 Warning: shmop_open(): unable to attach or create shared memory segment in /www/index.php on line 27 Could not open previously deleted block. ------------------------------------------------------------------------ [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/>'; } ?> ------------------------------------------------------------------------ [2005-05-15 02:00:15] [EMAIL PROTECTED] Provide a *short* and *readable* reproduce script without any "actions" and cases. Just a plain script that runs and shows wrong behaviour. ------------------------------------------------------------------------ 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