bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible bug: Race condition when calling external commands during t


From: Greg Wooledge
Subject: Re: Possible bug: Race condition when calling external commands during trap handling
Date: Tue, 22 May 2012 08:28:52 -0400
User-agent: Mutt/1.4.2.3i

On Tue, May 22, 2012 at 04:47:01AM -0700, Linda Walsh wrote:
> If you are in your trap handler, and you don't reset the signal --
> how can you guarantee that your signal handler will be reset
> before another even that would cause a trap occurs

You are using the wrong words for everything.

A signal is an asynchronous event, potentially sent by another process.

A signal handler is a bit of code that you write, and then register to
be executed when you receive a signal.

A trap is the same as a signal handler.  ''trap'' is the name of the
bash command to register a signal handler (assigning it to a set of
signals).

I do not know the answers to "How does bash implement traps?  Is there
a guarantee that no signals will be lost?"  Hopefully someone else does.

The man page has only a partial answer.  Under JOB CONTROL:

   Any trap on SIGCHLD is executed for each child that exits.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]