[Freeswitch-users] recvEvent causes zombies process

Anthony Minessale anthony.minessale at gmail.com
Wed Mar 30 01:25:12 MSD 2011


it's just a necessary thing to do when forking a child process.
so its fine that way if it's working.


On Tue, Mar 29, 2011 at 2:49 PM, Ejay Greeves <ejay.greeves at yahoo.com>wrote:

> I have added the second suggestion you made, so far I done it this way
> because it was easier to get the result. Is it correct how I have done it
> and if so does it take less resources the other way you suggest because at
> this stage I don't yet that
>
>
>
> loop do
> event = con.recvEvent
>        Signal.trap('CHLD', 'IGNORE')
> pid = fork do
>
> end
>
> Process.detach(pid)
> end
>
>
>
> --- On *Tue, 29/3/11, Anthony Minessale <anthony.minessale at gmail.com>*wrote:
>
>
> From: Anthony Minessale <anthony.minessale at gmail.com>
> Subject: Re: [Freeswitch-users] recvEvent causes zombies process
> To: "FreeSWITCH Users Help" <freeswitch-users at lists.freeswitch.org>
> Date: Tuesday, 29 March, 2011, 15:52
>
>
> you are calling fork every time you receive an event.
> you need to exit the process from the child and reap or ignore it on the
> parent.
>
>
> On Tue, Mar 29, 2011 at 6:09 AM, Ejay Greeves <ejay.greeves at yahoo.com<http://mc/compose?to=ejay.greeves@yahoo.com>
> > wrote:
>
> I am wanting to code an inbound event program.
>
> In order to see why I am getting zombie processes I stripped out all my
> code and used the minimum skeletcon code to do a test.
>
> con = ESL::ESLconnection.new('127.0.0.1', '8021', 'ClueCon')
> con.events("plain", "CHANNEL_HANGUP_COMPLETE")
>
> loop do
> event = con.recvEvent
>  pid = fork do
>
>
> end
>
> Process.detach(pid)
> end
>
>
> This code does nothing but wait for an incoming event, creates an fork then
> detach however it still produces a defunct process.
>
> I think con.recvEvent is the cause?
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org<http://mc/compose?to=FreeSWITCH-users@lists.freeswitch.org>
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
>
>
> --
> Anthony Minessale II
>
> FreeSWITCH http://www.freeswitch.org/
> ClueCon http://www.cluecon.com/
> Twitter: http://twitter.com/FreeSWITCH_wire
>
> AIM: anthm
> MSN:anthony_minessale at hotmail.com<http://mc/compose?to=MSN%3Aanthony_minessale@hotmail.com>
> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<http://mc/compose?to=PAYPAL%3Aanthony.minessale@gmail.com>
> IRC: irc.freenode.net #freeswitch
>
> FreeSWITCH Developer Conference
> sip:888 at conference.freeswitch.org<http://mc/compose?to=sip%3A888@conference.freeswitch.org>
> googletalk:conf+888 at conference.freeswitch.org<http://mc/compose?to=googletalk%3Aconf%2B888@conference.freeswitch.org>
> pstn:+19193869900
>
> -----Inline Attachment Follows-----
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org<http://mc/compose?to=FreeSWITCH-users@lists.freeswitch.org>
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>


-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale at hotmail.com
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org
googletalk:conf+888 at conference.freeswitch.org
pstn:+19193869900
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110329/60eb2719/attachment-0001.html 


More information about the FreeSWITCH-users mailing list