Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: deadlock caused by gettext usage in a signal handler



On Tue, 4 Dec 2007 19:43:14 +0100
Guillaume Chazarain <guichaz@xxxxxxxx> wrote:
> > > strerror_r also calls into gettext, so I don't see how this solves the
> > > problem.
> > 
> > strerror_r() is the way of ensuring thread safety in printing the
> > message by providing a buffer into which data is written.  The GNU
> > library manual entry does actually claim it's thread-safe; that
> > means that any hidden back-end functions it uses are thread-safe too.
> 
> Thread-safety does not imply async-signal-safety. It means locks and
> thread local storage, but these do nothing for signals. It would be
> great if sticking an _r would make functions callable in signal
> handlers ;-)

Indeed, it's as you say.  So the patch doesn't really help, since that's
the only case we have to worry about.  I don't see an easy way out at
the moment.

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



Messages sorted by: Reverse Date, Date, Thread, Author