|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-11-04 08:20 UTC] abecker at mailbox dot org
[2021-11-04 08:37 UTC] abecker at mailbox dot org
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 12:00:01 2025 UTC |
Description: ------------ Run test script 1-10 times to see that in spite of the fact shm_put_var returns true, shm_has_var() returns false. Calling sem_get() fixes the bug Test script: --------------- $processes = 300; $shmem = shm_attach(ftok(__FILE__, 'f'), 100000); // If uncomment next line shm_put_var works correctly // $sem = sem_get(ftok(__FILE__, 'a')); for ($i = 1; $i <= $processes; $i++) { if (pcntl_fork() === 0) { usleep(100000); $pid = getmypid(); $put_ok = shm_put_var($shmem, $pid, $i); if ($put_ok && !shm_has_var($shmem, $pid)) { print "shm_put_var() bug\n"; } exit(0); } } while (pcntl_wait($status) !== -1){} shm_remove($shmem); shm_detach($shmem);