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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
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-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 11:01:28 2024 UTC