Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Call stack issues when running trap handler
- X-seq: zsh-workers 40996
- From: Sebastian Reuße <seb@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Call stack issues when running trap handler
- Date: Fri, 21 Apr 2017 22:32:46 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wirrsal.net; s=wirrsal; t=1492806768; bh=qJ5kQ+GkPOvmAZvbgYdY6IwOLe28KC/J9RVsGK0lHNE=; h=From:To:Subject:Date; b=ixfVwJH/WBbxotCbcdejnhH74l+FVx4FSJj5Dt39XfCIkN+5IMMkXQZc2J/nCPUY3 f7d57z1kZkeD5Qxu20qJd9x/ip+OOW9hpLrQDh5Kc+DM2SLHdLrZxS3yC8v+OiKt5B E0V5B5RCJiUD4kzMQgcGLKoyXPBIH19ll24ejXhQ=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
I’ve noticed that under certain conditions, shell functions called from
inside an exit trap handler appear to never return. E.g., running the
following code will only yield «a» as output, indicating that callee
«echoa» never returns control to the caller «handler».
#+begin_src shell
trap handler EXIT
handler() {
echoa
echo b
}
echoa() {
echo a
}
exit0() {
exit
}
main() {
exit0
}
main
#+end_src
When directly calling «exit0» or «exit» instead of «main», this issue
does not arise.
I was able to reproduce this both in Zsh 5.3.1 as well as today’s HEAD.
Kind regards,
SR
Messages sorted by:
Reverse Date,
Date,
Thread,
Author