[Top][All Lists]

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

Re: [BUG] RETURN trap with -o functrace: infinite recursion on 'eval ret

From: Martijn Dekker
Subject: Re: [BUG] RETURN trap with -o functrace: infinite recursion on 'eval return'
Date: Sat, 14 Apr 2018 05:29:01 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

Op 14-04-18 om 03:49 schreef Chet Ramey:
On 4/10/18 5:56 AM, Martijn Dekker wrote:
It seems odd that the RETURN trap would be triggered while a RETURN trap
action is still being executed. Might it be better to temporarily
deactivate the effect of '-o functrace' while a RETURN trap action is being

Well, trap handlers are recursive, in the sense that you can execute a trap
on signal X from a signal X trap handler.

I'm not sure how that would happen. Isn't a signal blocked while executing its trap handler?

 If the RETURN trap is inherited
by functions, and traps are recursive, wouldn't the bash behavior be the
logical thing to do?

I suppose. But if a signal is blocked while executing the respective trap, perhaps it would also be logical to deactivate the RETURN pseudosignal while executing a RETURN trap.

It seems like this is already done for the ERR pseudosignal, as "trap false ERR; false" does not cause an infinite loop.

- M.

reply via email to

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