Re: Fixing UML against NPTL (was: Re: [uml-devel] [PATCH] UML: Use PTRACE_KILL instead of SIGKILL to kill host-OS processes (take #2))

Daniel Jacobowitz
2004-11-11T18:50:06Z

On Thu, Nov 11, 2004 at 07:31:51PM +0100, Christophe Saout wrote:
> Am Donnerstag, den 11.11.2004, 12:45 -0500 schrieb Daniel Jacobowitz:
>
> > Glibc caches the PID. If you're going to use clone directly, use the
> > gettid/getpid syscall directly. It's kind of rude that glibc breaks
> > getpid in this way; I recommend filing a bug in the glibc bugzilla at
> > sources.redhat.com.

... but, thinking about it, they'll probably close it as INVALID.

> If glibc insists on caching the pid, it could also simply invalidate the
> pid cache in the clone function.

It currently does this for vfork, but not clone. Basically, you can't
call into glibc at all if you use clone. If you aren't using POSIX
threads, then the POSIX-compliant library is going to fall to pieces
around you. For instance, all the file locking will break, and
anything else that, like the PID cache, relies on either global or
per-_thread_ data.

--
Daniel Jacobowitz