This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Don't close or flush stdio streams on abort


On Wed, May 08, 2013 at 02:02:56PM +0200, Andreas Schwab wrote:
> OndÅej BÃlka <neleai@seznam.cz> writes:
> 
> > However removal at stage 4 could cause debugging info not be displayed.
> > Could it be possible to ignore delivery with something like sigprocmask?
> 
> Ignore what delivery?

OndÅej seems to be confused that async-signal-safety has to do with
arrival of a signal while abort() is in progress, rather than calling
abort() from a signal handler, possibly while the locks are held.

With the right types of locks, a trylock operation could be performed
instead of waiting for a lock. This requires an async-signal-safe,
reentrant, recursive mutex. We have them in musl but I don't know if
glibc uses a type of lock that could easily be made reentrant. (The
key trick we use is that, when the lock is held, the reference count
is one less than the actual number of references, so that there's no
race window between taking the lock and setting count to 1.)

Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]