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 24155
- From: Guillaume Chazarain <guichaz@xxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: deadlock caused by gettext usage in a signal handler
- Date: Tue, 4 Dec 2007 19:43:14 +0100
- In-reply-to: <200712041824.lB4IOowf006457@xxxxxxxxxxxxxx>
- 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>
Le Tue, 04 Dec 2007 18:24:50 +0000,
Peter Stephenson <pws@xxxxxxx> a écrit :
> Guillaume Chazarain wrote:
> > Zsh seems to use dlerror though, hopefully not in a signal handler.
>
> No, the shell is quite cautious what it executes in signal handlers;
> system errors are pretty much inevitable, but there's no module handling
> there so no call to dlerror.
OK, great.
>
> > 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 ;-)
There are more details in this blog post:
http://girtby.net/archives/2006/12/18/the-other-kind-of-reentrant
Thanks.
--
Guillaume
Messages sorted by:
Reverse Date,
Date,
Thread,
Author