Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: deadlock caused by gettext usage in a signal handler
- X-seq: zsh-workers 24156
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Guillaume Chazarain <guichaz@xxxxxxxx>, Zsh Hackers' List <zsh-workers@xxxxxxxxxx>
- Subject: Re: deadlock caused by gettext usage in a signal handler
- Date: Tue, 4 Dec 2007 19:43:09 +0000
- In-reply-to: <20071204194314.136c08ad@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20071130203534.1d1ea29c@xxxxxxxx> <20071203224324.247fb30f.p.w.stephenson@xxxxxxxxxxxx> <20071204190219.037a5400@xxxxxxxx> <200712041824.lB4IOowf006457@xxxxxxxxxxxxxx> <20071204194314.136c08ad@xxxxxxxx>
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