This is the mail archive of the libc-alpha@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]

Re: [PATCH] nptl: Fix racy pipe closing in tst-cancel{20,21}


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


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