This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: NPTL futex error handling
- From: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 27 Jan 2014 20:08:06 +0530
- Subject: Re: NPTL futex error handling
- Authentication-results: sourceware.org; auth=none
- References: <52E66CD1 dot 5030402 at redhat dot com>
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?
The allocation happens only once, so the chances of it failing are
very remote. One could engineer a failure I guess, by exhausting
memory before the first call to pthread_mutex_lock on a PI mutex. I'm
not sure how useful that would be, but it might be worth a look.
Siddhesh
--
http://siddhesh.in