PHP 4.0 Bug #9259: crash when accessing shared memory + more info on bug #8985
| From: | fuf at mobil dot cz | Date: | Wed, 14 Feb 2001 13:47:02 +0000 |
| Subject: | PHP 4.0 Bug #9259: crash when accessing shared memory + more info on bug #8985 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-46558@lists.php.net to get a copy of this message | ||
From: fuf@mobil.cz
Operating system: linux-2.2.18
PHP version: 4.0.4pl1
PHP Bug Type: Reproduceable crash
Bug description: crash when accessing shared memory + more info on bug #8985
hello,
when accessing a shared memory region that i don't have access to (because of the
permissions), php segfaults.
so if i have a shared memory region created by another user with key 0x123 and permissions 0600
and call shm_attach(0x123), php crashes:
<?
$shmid = shm_attach(0x123);
shm_detach(0x123);
?>
also, i know some more info concerning the bug #8985: when one process is reading some variable
from the shared memory and some other is writing _another_ variable to the same shared memory
region, the data gets corrupted - possibly because of the reorganizing before each shm_put_var().
while this is understandable (shm_put_var() first removes the variable, reorganizes the region and
writes the variable back), it renders this extension almost unusable in multitasking environments
because a big global lock for the whole shared memory region is needed.
i can supply more information if needed of course.
thanks,
Michal Vitecek
--
Edit Bug report at: http://bugs.php.net/?id=9259&edit=1