[CRIU] [PATCH 2/7] tests: add a ZDTM_NOREAP variable

Tycho Andersen tycho.andersen at canonical.com
Tue Jun 28 07:54:16 PDT 2016


On Tue, Jun 28, 2016 at 03:42:45PM +0300, Pavel Emelyanov wrote:
> On 06/23/2016 06:13 PM, Tycho Andersen wrote:
> > We'll use this variable in the next test to make sure the test suite
> > doesn't accidentally reap the zombie we want to leave around for the actual
> > test.
> > 
> > This is kind of ugly and there might be a better way to pass information to
> > the test's init, I'm open for suggestions :)
> 
> That's (hopefully) fine, but I have concern about patch #1 -- can we keep
> original behavior (wait in a loop) if NOREAP is _not_ given? The thing is
> that ns init is supposed to pick up a lot of trash, not only the one _it_
> has explicitly spawned.

Yes, I will re-send that patch.

> > @@ -290,12 +295,12 @@ int ns_init(int argc, char **argv)
> >  
> >  	show_ps();
> >  
> > -	if (sigaction(SIGCHLD, &sa, NULL)) {
> > +	if (reap && sigaction(SIGCHLD, &sa, NULL)) {
> >  		fprintf(stderr, "Can't set SIGCHLD handler: %m\n");
> >  		exit(1);
> >  	}
> >  
> > -	while (1) {
> > +	while (reap && 1) {
> 
> %) Why?!

Because otherwise it will reap the zombie we create in the test. I hit
this problem when you try and checkpoint something where the init
hasn't yet reaped the zombie (presumably because it was busy doing
something else), so we need to simulate that somehow here.

> >  		int status;
> >  
> >  		pid = waitpid(-1, &status, WNOHANG);
> > 
> 


More information about the CRIU mailing list