[igt-dev] [PATCH i-g-t] lib: Kill residual children at the end of a subtest

Chris Wilson chris at chris-wilson.co.uk
Mon Feb 3 12:25:41 UTC 2020


Quoting Petri Latvala (2020-02-03 12:23:05)
> On Mon, Feb 03, 2020 at 12:00:35PM +0000, Chris Wilson wrote:
> > Quoting Petri Latvala (2020-02-03 11:50:07)
> > > Care to beef up lib/tests/igt_fork.c to make sure this is all done
> > > gracefully at subtest level, currently it only checks that the state
> > > is sane at exit() time?
> > 
> > Something evil like:
> > 
> > pid_t *children = mmap(4096, SHARED);
> > 
> > igt_subtest() {
> >       igt_fork(child, 4096/sizeof(pid_t)) {
> >               children[child] = getpid();
> >       }
> >       /* leak the children */
> > }
> > 
> > for (int i = 0; i < 4096/sizeof(pid_t); i++)
> >       assert(kill(children[i], 0) == -1);
> > munmap(children, 4096);
> > 
> > Is that legal?
> 
> Do we need crazy? lib-tests get run on qemu'd mips and arm,
> and anyway fork-bombing on gitlab is not very nice.

Bah, it's not that crazy. 1024 processes, barely a scratch :)

I didn't think it's particularly onerous, but I don't have much
experience with the gitlab-ci targets.
-Chris


More information about the igt-dev mailing list