mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Subject: Re: Possibly spurious EAGAIN seen in pthread_key_create on x86
Date: Wed, 23 Jan 2019 06:22:35 +0100	[thread overview]
Message-ID: <20190123052235.GC23924@voyager> (raw)
In-Reply-To: <7ccdc4b9-c06e-5c76-6783-38f9cf297a14@adelielinux.org>

On Tue, Jan 22, 2019 at 03:15:35PM -0600, A. Wilcox wrote:
> Hello there muslers,
> 
> While running the test suite for GLib++ (the C++ wrapper for GLib) on
> our 32-bit x86 builder (i686), after upgrading to 1.1.21, it logged:
> 
> 
> FAIL: glibmm_mainloop/test
> ==========================
> GLib (gthread-posix.c): Unexpected error from C library during
> 'pthread_key_create': Resource temporarily unavailable.  Aborting.
> 
> 
> Running the test suite an additional 160 (one hundred and sixty) times
> could not repeat the result.  Still, I wanted to report it on the
> off-chance there is some significance to this single result.
> 
> Importantly, I haven't noticed this failure on any of the other
> architectures we've built GLib++ on (ppc32, ppc64, aarch64).
> 
> Best,
> --arw
> 
> -- 
> A. Wilcox (awilfox)
> Project Lead, Adélie Linux
> https://www.adelielinux.org
> 


That error message is the message for EAGAIN. pthread_key_create()
returns EAGAIN if found_dirty == 0 or clean_dirty_tsd() failed. The
former would mean that the test suite tried to create more than
PTHREAD_KEYS_MAX keys, but since that value is static, barring a weird
usage pattern, you'd get the error always.

So it's going to be the latter. clean_dirty_tsd() does a synccall. It
will return an error if the calling thread is unable to signal itself
enough to run the callback. Or, if somehow the value of __pthread_self()
changed between the start of clean_dirty_tsd() and the end of
clean_dirty_tsd_callback(), but that is space fairy territory, isn't it?

No, the only way I see to get through __synccall() without calling the
callback at least in the calling thread, is to go to the label "out:",
which only happens if /proc/self/task could not be opened.

So I guess you ran afoul of a temporary failure in open(), then.

Ciao,
Markus


      parent reply	other threads:[~2019-01-23  5:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 21:15 A. Wilcox
2019-01-23  0:57 ` Rich Felker
2019-01-23  5:22 ` Markus Wichmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190123052235.GC23924@voyager \
    --to=nullplan@gmx.net \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).