ZF-10008: Shared memory segment and semaphore never deleted in ZendX_Console_Process_Unix
Description
The shared memory segments, semaphores and related files (*.shm and *.sem) are never being deleted when the process is stopped. shmod_delete and shmop_close function are simply ignored ...
class executeThread extends Concentre_Console_Process_Unix
{
protected function _run()
{
for ($i = 0; $i < 10; $i++) {
// Doing something really important which can't wait: sleeping
sleep(1);
}
}
}
$thread1 = new executeThread();
$thread1->start();
$thread2 = new executeThread();
$thread2->start();
while ($thread1->isRunning() || $thread2->isRunning()) {
sleep(1);
}
I'm running PHP 5.2.6 under debian.
Below I've paste shared memory segments summary output after script execution.
ipcs -m
---- Segmentos memoria compartida ----
key shmid propietario perms bytes nattch estado
0x00000000 34963456 root 666 294912 11 dest
0x00000000 34996225 root 666 557056 11 dest
0x740ebcac 343441410 root 644 10240 0
0x740ebcae 343474179 root 644 10 0
0x740ebcb0 343506948 root 644 10240 0
0x740ebcb2 343539717 root 644 10 0
Seems that when process is forked php is unable to control shared memory. I've try to create segment /semaphore with the same code as in ZendX_Console_Process_Unix class but without forking and it works !
Segments are created and deleted perfectly.
Comments
No comments to display