https://bugs.kde.org/show_bug.cgi?id=421931

--- Comment #7 from Mark Wielaard <m...@klomp.org> ---
(In reply to Carlos O'Donell from comment #5)
> (In reply to Mark Wielaard from comment #3)
> > What is a "detached thread" according to you?  There is no concept of
> > detached threads in valgrind, all threads are under control of valgrind and
> > valgrind makes sure that only one (kernel) thread is scheduled to run at any
> > one time. See
> > https://valgrind.org/docs/manual/manual-core.html#manual-core.pthreads
> 
> If you use ptrace under the hood to stop a pthread detached thread, and
> therefore terminate it, then yes, there will be nothing else using the
> streams.
> 
> If that's the case, and we feel comfortable with that as a position then I
> can flip this back to glibc and discuss *always* shutting down streams via
> __libc_freeres regardless of their state?

We don't use ptrace under the hood, we control all kernel threads. From the
perspective of glibc valgrind provides the kernel interface. Valgrind core
doesn't use glibc itself. From the perspective of valgrind glibc is just like
any other code the process executes. With some exceptions, we intercept some
glibc functions, most specifically __libc_freeres. That function is called
after the process exits (from glibc's perspective). We should probably make
sure there are no other users of __libc_freeres, or if there are, that they use
it in the same way. So it seems a good idea to put this back to glibc.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to