|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68154 Event::add() on event signal notice in forked child...
Submitted: 2014-10-04 20:45 UTC Modified: 2014-11-10 11:29 UTC
From: info-phpbugs at ch2o dot info Assigned: osmanov (profile)
Status: Closed Package: event (PECL)
PHP Version: 5.5.17 OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: info-phpbugs at ch2o dot info
New email:
PHP Version: OS:


 [2014-10-04 20:45 UTC] info-phpbugs at ch2o dot info
i initialise EventBase on master process.
$this->base = new EventBase();

i add signal event like that on master process:

$event = new Event($this->base, SIGTERM, Event::SIGNAL  | Event::PERSIST , array($this, "EventTERM"));

i initialise another eventbase

$this->listenerbase = new EventBase();

i initialise EventListener on socket in master process on this base.
$listener = new EventListener($this->listenerbase,
                                                 [$this, 'ev_accept'],
                                                      EventListener::OPT_CLOSE_ON_FREE | EventListener::OPT_REUSEABLE,

i fork and in the child i reinit the EventListener EventBase and try to unset the first EventBase who i've attached the signal SIGTERM and add new signal event SIGTERM on the listenerbase then dispatch on them.

but notice a the message:
Notice: Event::add(): Added a signal to event base 0x1d43f30 with signals already added to event_base 0x1d3aec0.  Only one can have signals at a time with the epoll backend. 

when searching on the net about this message i found similar use of signal handler on libevent list:

the probleme are in fact that cannot free completly the master process eventbase on the child...

i've tryed to reinit, and delete/free all event, and unset the eventbase object... and force collecting garbage...

and the notice while continue to appeare...

Expected result:
to abel to completely free the eventbase to avoid this notice message.
in the object version of this extension the freeing of the eventbase rely on the destruction of the object... adding free method on the eventbase to explicitly free the object while resolve the probleme i think...


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-10 11:21 UTC]
Again I missed notification. Please submit event-specific bugs on the project page next time:
 [2014-11-10 11:29 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: osmanov
 [2014-11-10 11:29 UTC]
EventBase::free() method has been added recently:
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed May 27 07:01:27 2020 UTC