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


Groups > gnu.bash.bug > #14048

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

Path csiph.com!xmission!weretis.net!feeder6.news.weretis.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!171.64.64.130.MISMATCH!usenet.stanford.edu!not-for-mail
From Martijn Dekker <martijn@inlv.org>
Newsgroups gnu.bash.bug
Subject Re: [BUG] RETURN trap with -o functrace: infinite recursion on 'eval return'
Date Sat, 14 Apr 2018 05:29:01 +0200
Lines 26
Approved bug-bash@gnu.org
Message-ID <mailman.12345.1523676564.27995.bug-bash@gnu.org> (permalink)
References <34b02ae0-06b5-0559-a085-efeccc468732@inlv.org> <cafefab8-e34e-e2e0-e6d6-ec9961dfdf66@case.edu>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace usenet.stanford.edu 1523676564 17847 208.118.235.17 (14 Apr 2018 03:29:24 GMT)
X-Complaints-To action@cs.stanford.edu
To chet.ramey@case.edu, "bug-bash@gnu.org" <bug-bash@gnu.org>
Envelope-to bug-bash@gnu.org
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.7.0
In-Reply-To <cafefab8-e34e-e2e0-e6d6-ec9961dfdf66@case.edu>
Content-Language en-GB
X-detected-operating-system by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From 37.59.109.123
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14048

Show key headers only | View raw


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?

>  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.

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: [BUG] RETURN trap with -o functrace: infinite recursion on 'eval return' Martijn Dekker <martijn@inlv.org> - 2018-04-14 05:29 +0200

csiph-web