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: NPTL futex error handling


On Mon, Jan 27, 2014 at 03:53:22PM +0100, Florian Weimer wrote:
> On 01/27/2014 03:38 PM, Siddhesh Poyarekar wrote:
> >On 27 January 2014 19:57, Florian Weimer <fweimer@redhat.com> wrote:
> >>Looking at the kernel code, I believe that FUTEX_LOCK_PI and FUTEX_WAKE (in
> >>the case of cross-process mutexes, it seems) can fail with ENOMEM, in
> >>addition to the more-or-less expected failure cases.
> >>
> >>Is the ENOMEM return value due to kernel changes after the initial futex
> >>implementation, or has this already been evaluated and deemed not be
> >>necessary for correctness?
> >
> >I guess you're referring to the return from refill_pi_state_cache?
> 
> Yes, and the call to get_user_pages in the cross-process case.

Hmmm, I (incorrectly) assumed that get_user_pages would only return
EFAULT.  get_user_pages failing with ENOMEM will impact everything,
even regular FUTEX_WAIT.  In fact, it doesn't look like
pthread_mutex_lock is supposed to return EFAULT either.

Siddhesh


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