From: Silas S. <si...@gm...> - 2013-01-11 14:38:28
|
On Tue, Nov 13, 2012 at 05:23:40PM +0100, Arnout Engelen wrote: > On Mon, Nov 12, 2012 at 12:06:02AM -0200, Silas Silva wrote: > > I soon realized that time events were generated by SIGALRM. So there > > could be anything related with signals. So, my investigations confirm > > that a minor change is necessary to make it work. Just comment line 543 > > of libmainloop/signal.c: > > > > sigaction(SIGCHLD, &sa, NULL); > > > > And it works like a charm, but I don't know if it breaks other things. Yes, months later I see it breaks other things. Details below. :-/ > > Why SIGCHLD is being intercepted? > > I haven't looked *too* closely yet, but it seems this is used somehow in > libmainloop. Looks like it is used to provide a 'mainloop_sigchld_hook' hook, > but I don't see this hook actually being used anywhere. Without that line, spawned processes (sh) are dead (zombie), but do not free the pid. In systems with small number of allowed processes per user (ulimit -p), like mine (my NetBSD environment), soon it reaches the situation where I run out of resources and fork() fail. I tested it under NetBSD (5.1) and Ubuntu GNU/Linux (12.10). This behaviour (creation of zombie process without the sigaction() line) is the same on both. Maybe understand that snippet of code and add comments are valuable. I intend to investigate the problem further, to allow correct behaviour of statusd in NetBSD and do not allow the creation of zombie process. Thanks for now! :-) -- Silas Silva |