This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] nptl: Fix racy pipe closing in tst-cancel{20,21}
- From: Florian Weimer <fweimer at redhat dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, libc-alpha at sourceware dot org
- Date: Wed, 2 Dec 2015 20:00:41 +0100
- Subject: Re: [PATCH] nptl: Fix racy pipe closing in tst-cancel{20,21}
- Authentication-results: sourceware.org; auth=none
- References: <1444849395-18800-1-git-send-email-adhemerval dot zanella at linaro dot com>
On 10/14/2015 09:03 PM, Adhemerval Zanella wrote:
> + /* The pipe closing must be issued after the cancellation handling to avoid
> + a race condition where the cancellation runs after both pipe ends are
> + closed. In this case the read syscall returns EOF and the cancellation
> + must not act. */
I find this comment confusing. What is actually happening during a
spurious failure? The thread which is supposed to be canceled sees a
failed read from the pipe instead?
In this case, the return value from the read should be checked in a more
stringent fashion. Or is the read not supposed to return at all? Then
why have two read calls instead of one?
Florian