This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [MTASCsft PATCH 03/??] MT-, AS- and AC-Safety docs: manual/arith.texi
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: <codonell at redhat dot com>, <libc-alpha at sourceware dot org>
- Date: Thu, 23 Jan 2014 18:41:45 +0000
- Subject: Re: [MTASCsft PATCH 03/??] MT-, AS- and AC-Safety docs: manual/arith.texi
- Authentication-results: sourceware.org; auth=none
- References: <ortxelb5zd dot fsf at livre dot home> <or4n4uoncj dot fsf at livre dot home> <orr47yn3kl dot fsf_-_ at livre dot home> <Pine dot LNX dot 4 dot 64 dot 1401231606360 dot 31884 at digraph dot polyomino dot org dot uk> <ory526lfrz dot fsf at livre dot home>
On Thu, 23 Jan 2014, Alexandre Oliva wrote:
> - the functions are interrupted by a signal whose handler relies on the
> FP env. IIRC that's what the existing observation covers, but it makes
> me wonder if the functions that rely on the FP env become AS-Unsafe
> because the FP env might be in an inconsistent state. I didn't think
> so, because it was clear that signal handlers had to set up their own FP
> environment to be on the safe side.
They need to set up their own environment regardless of what they
interrupt, given that the compiler might generate code changing the
environment temporarily, subject to questions of when they can rely on a
particular environment being set by the kernel in a signal handler.
> - the functions are interrupted by an asynchronous cancellation. the
> thread-local FP enviroment may be left to die in a corrupt state along
> with the rest of the thread. The one point of concern is cleanup
> handlers, should they rely on the FP environment being set in a specific
> way. Considering that they could be called even from within signal
> handlers that override the FP environment, that wouldn't be advisable,
> so they should set up the FP environment for their own execution just
> like signal handlers have to.
I think documenting AC-Safety should include making clear what cleanup
handlers may do, as well as the effect of cancellation during a given
function. That may mean a note about setting a known FP environment.
--
Joseph S. Myers
joseph@codesourcery.com