This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] mips: Remove rt_sigreturn usage on context function
On 25/06/2019 09:24, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> My understanding is an implementation detail that a function not
>> required to be a async-signal-safe might be safe to be called from a
>> signal handler.
>
> This is my understanding as well, but the glibc project as a whole
> clearly does not share this view. The manual documents AS-safety based
> on the state of the implementation a while back. We even document *why*
> an interface is not AS-safe, so presumably applications which do not
> care about certain deadlocks (because they take measures that they
> cannot happen) can still use AS-unsafe functions in signal handlers.
>
> The downside is that a programmer reading the manual cannot know if a
> function marked as AS-safe is so because it's a supported property of
> the interface, or an emergent aspect of the implementation at the time
> of the last review.
Some documentation specifics emerge from implementation detail, so I
see that this does not really clash with my understanding. Maybe we should
add that although glibc implementation is AS-safe, this is defined by
standard and non-portable (something like what gnulib does).
>
> I also think it's wrong to document the extent to which AS-unsafe
> functions can be called in signal handlers. It's undefined behavior,
> plain and simple.
>
> Thanks,
> Florian
>