This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] [BZ #19402] Clear list of acquired robust mutexes in the child process after forking.
- From: Torvald Riegel <triegel at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>, "Carlos O'Donell" <codonell at redhat dot com>
- Date: Tue, 24 Jan 2017 21:27:51 +0100
- Subject: Re: [PATCH] [BZ #19402] Clear list of acquired robust mutexes in the child process after forking.
- Authentication-results: sourceware.org; auth=none
- References: <1482401752.14990.777.camel@redhat.com> <6f2ee6d9-198b-3396-5836-048c966b7c60@redhat.com> <1482528683.14990.861.camel@redhat.com> <01fef17b-b650-a93a-a7c9-b784a51c6602@redhat.com> <1484321857.5606.305.camel@redhat.com> <661365b6-432e-d8e9-50ff-c10fdde05e09@redhat.com>
On Mon, 2017-01-23 at 15:57 +0100, Florian Weimer wrote:
> On 01/13/2017 04:37 PM, Torvald Riegel wrote:
> > On Fri, 2017-01-13 at 14:11 +0100, Florian Weimer wrote:
> >> On 12/23/2016 10:31 PM, Torvald Riegel wrote:
> >>>> Can we add a test case for this?
> >>> What do you have in mind? Checking that the list is reset to zero after
> >>> fork? Do we need a test for that if we have documented the need to do
> >>> that in the code?
> >>
> >> What about the attached patch?
> >
> > That looks fine generally, with the following exceptions / comments:
> >
> > According to the feedback so far we got for
> > http://austingroupbugs.net/view.php?id=1112 the trylock-based test is
> > actually UB. There should be a comment making that clear (ie, that we
> > rely on something we know about our current implementation to test
> > this).
> >
> > If this was a multi-threaded test program, it would be invalid because
> > non-async-signal-safe functions are executed in the child before exec()
> > is called. In a single-threaded program, it's not quite clear to me
> > what POSIX really wants. There's indication that only AS-safe functions
> > should be called, but IIRC that's not explicitly stated.
> > Florian says we still need to support this as an extension. If so, this
> > should be made clear in the test (using a suitable comment).
>
> I added a comment and an additional test which uses an error-checking mutex.
>
> Test case still passes on current master. Okay to commit?
LGTM.