php.net |  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.
Password:
Status:
Package:
Bug Type:
Summary:
From: info-phpbugs at ch2o dot info
New email:
PHP Version: OS:

 

 [2014-10-04 20:45 UTC] info-phpbugs at ch2o dot info
Description:
------------
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"));
$event->add();

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'],
                                                 $this,
                                                      EventListener::OPT_CLOSE_ON_FREE | EventListener::OPT_REUSEABLE,
                                                 -1,
                                                 "localhost:80"))

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:
http://archives.seul.org/libevent/users/Mar-2011/msg00008.html
http://sourceforge.net/p/levent/bugs/224/

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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-10 11:21 UTC] osmanov@php.net
Again I missed notification. Please submit event-specific bugs on the project page next time: https://bitbucket.org/osmanov/pecl-event/issues
 [2014-11-10 11:29 UTC] osmanov@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: osmanov
 [2014-11-10 11:29 UTC] osmanov@php.net
EventBase::free() method has been added recently:
https://bitbucket.org/osmanov/pecl-event/commits/1b2a23b0403754272fd76459ac9be83ec5379c19
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Aug 18 23:01:26 2019 UTC