tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: resource leak in linux emulation?

On Thu, Apr 17, 2014 at 01:23:15AM +0200, Sergio L?pez wrote:
> 2014-04-03 11:57 GMT+02:00 Mark Davies <>:
> > Note that nprocs (2nd to last value in the /proc/loadavg output)
> > increments every time javac runs until it hits maxproc.
> You're right, the problem appears when the last thead alive in a
> multithreaded linux process is not the main thread, but one of the
> children. This only happens with when using the linux emulation,
> because is the only case when LWPs have their own respective PIDs.
> To fix, this should be added somewhere, probably at
> sys/kern/kern_exit.c:487 (but I'm not sure if there's a better
> location):
>         if ((l->l_pflag & LP_PIDLID) != 0 && l->l_lid != p->p_pid) {
>                 proc_free_pid(l->l_lid);
>         }

That doesn't look like the right place.
I think it should be further down (and with proc_lock held).


David Laight:

Home | Main Index | Thread Index | Old Index