[PATCH 2/2] mips: Remove rt_sigreturn usage on context function

Florian Weimer fweimer@redhat.com
Tue Jun 25 12:24:00 GMT 2019


* 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.

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



More information about the Libc-alpha mailing list