This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/21793] glibc does not update the pid/tid cache after clone()


https://sourceware.org/bugzilla/show_bug.cgi?id=21793

--- Comment #3 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Carlos O'Donell from comment #2)
> Once you call clone() you own the created thread, and you cannot use any
> POSIX Thread functions provided by the libc you left behind when you cloned
> a new thread manually. If you are using clone() as a convenience function
> for unshare() then you should use unshare().

That is very misleading.  If you call clone to create a new *thread*, you
cannot use any glibc function at all, whether POSIX threads or not.  *Nothing*
will work on the new thread, not even async-signal-safe functions.  A lot of
things worked by accident, most of the time, including malloc, but with the
thread cache in 2.26, malloc will no longer be reliable, for instance.

We still need a correct TID if the clone call created a new process, though. 
There is really no way around that.  This will be tricky due to vfork.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]