This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Consensus on MT-, AS- and AC-Safety docs.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Carlos O'Donell <carlos at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>, Rich Felker <dalias at aerifal dot cx>, Torvald Riegel <triegel at redhat dot com>, Alexandre Oliva <aoliva at redhat dot com>
- Date: Wed, 20 Nov 2013 08:30:02 +0100
- Subject: Re: Consensus on MT-, AS- and AC-Safety docs.
- Authentication-results: sourceware.org; auth=none
- References: <528A7C8F dot 8060805 at redhat dot com> <Pine dot LNX dot 4 dot 64 dot 1311182312130 dot 8831 at digraph dot polyomino dot org dot uk> <528BA2DA dot 3090608 at redhat dot com> <Pine dot LNX dot 4 dot 64 dot 1311192205550 dot 8742 at digraph dot polyomino dot org dot uk>
On Tue, Nov 19, 2013 at 10:39:22PM +0000, Joseph S. Myers wrote:
> On Tue, 19 Nov 2013, Carlos O'Donell wrote:
>
> > Regarding the documenting of a bug for which a patch exists, that is
> > now in Alex's court to remove the documentation for that since you've
> > just checked in your patch for powerpc-nofpu floating point state
> > after Adhemerval's (IBM) review.
>
> Although the simfpu annotations are now obsolete, there's still I think a
> use for another annotation or two for affected functions, as a matter of
> AS-Safety not MT-Safety:
>
> * libm functions generally may set the thread-local errno. If a signal
> handler calls such a function without saving and restoring errno, whatever
> code in the thread was interrupted may see an unexpected errno change, and
> libc code may not be robust against errno changing asynchronously during a
> libc function. (I don't know if there are functions beyond the libm and
> strtod/atof families that are AS-Safe but with an errno caveat.)
>
This could be solved by wrapping a handler in function that saves and
restores errno. You could make functions also safe in this regard or
decide that implementing solution is too expensive.