ZF-10008: Shared memory segment and semaphore never deleted in ZendX_Console_Process_Unix

Issue Type: Bug Created: 2010-06-17T12:23:37.000+0000 Last Updated: 2012-11-20T21:37:27.000+0000 Status: Open Fix version(s): Reporter: S├ębastien Cramatte (scramatte) Assignee: None Tags: - ZendX_Console_Process_Unix

Related issues: Attachments:


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 ...

<pre class="highlight"> 
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
 $thread1 = new executeThread();
 $thread2 = new executeThread();
 while ($thread1->isRunning() || $thread2->isRunning()) {

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.


No comments to display

Have you found an issue?

See the Overview section for more details.


© 2006-2021 by Zend by Perforce. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.