Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14049 > unrolled thread

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

Started byChet Ramey <chet.ramey@case.edu>
First post2018-04-15 22:04 -0400
Last post2018-04-15 22:04 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [BUG] RETURN trap with -o functrace: infinite recursion on 'eval return' Chet Ramey <chet.ramey@case.edu> - 2018-04-15 22:04 -0400

#14049 — Re: [BUG] RETURN trap with -o functrace: infinite recursion on 'eval return'

FromChet Ramey <chet.ramey@case.edu>
Date2018-04-15 22:04 -0400
SubjectRe: [BUG] RETURN trap with -o functrace: infinite recursion on 'eval return'
Message-ID<mailman.12481.1523844277.27995.bug-bash@gnu.org>
On 4/13/18 11:29 PM, Martijn Dekker wrote:
> 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
>>> executed?
>>
>> 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?

No. Since trap handlers are not executed in a signal handler context,
there's no reason to block signals while a trap handler is running. Bash
doesn't generally allow a trap handler for signal X to run while a trap
handler for signal X is executing, but other shells do. This (bash not
allowing this trap recursion generally) has been reported as a bug in the
past.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web