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: [MTASCsft PATCH 03/??] MT-, AS- and AC-Safety docs: manual/arith.texi


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


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