Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Bug with traps and exit
- X-seq: zsh-workers 44007
- From: Martijn Dekker <martijn@xxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Bug with traps and exit
- Date: Mon, 21 Jan 2019 23:00:09 +0000
- Autocrypt: addr=martijn@xxxxxxxx; prefer-encrypt=mutual; keydata= xsDNBFVvW4wBDADV3z/EXaKGxp/KJ4iWK0UaiNaXBx3wYzwmeN/vN8uYsplaLIZdwf3RjhIG vV6cVi0byt3ezTTGfw1ErgH4fUzobu87EaX07jlVgK5tztNGcohmTjFe6rFgj1WEk/i2zjyS 3yL2fa4bjJsXAFpJiNj0yYwdnqADI7hkBvNk4GZc3RPEYfNnUQ/O5xigc1Vq3ZqjbORseETe Op9gELvxWNwZbLD9DykYJFElDk6NwjscIqXQXus+O5JKzcEEYOC7Ut6XSJ5P5Ca1R6bzLRgf ZTaaedEryb19YHPIrdZd5Z6ET2PtKxPM+hzUtFG8oQwO4+nc7Zeq3wX9y62eWbOfJFeDZktc 70X4zsaG74XO1+Jarl1sid8XaIitfC1kbGI++x+Ehw8TLtqxmkaLVMcdJ4QRYlMUxHhvqanj +DlTcsLXS690Dka8Sca13UZ41Bk6F8JpQZgVzvIAnV1PZtN1+c/G4DAp5v0zfAPikHJkWAEn 0b83e1V9tHR2bovHfwyEe4sAEQEAAc0hTWFydGlqbiBEZWtrZXIgPG1hcnRpam5AaW5sdi5v cmc+wsD5BBMBCAAjBQJVb1uMAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQgQYS pNaUtYHGKAwAvJ81lu/894/zJI7uWNHtVkswMiqlFoA4AhoJKEhq0PbDmWH8xGmN9ykQHec+ FRI1kPAtfxx3VNNZ3gK/4gG8o7uZAKnw8Elkk8tORYO38w/+jivXYUeZn2o2yE6USSpuDohQ mWKc34vkg6FAdyau12SYxIGPsokV2uIGoqfLFl7dvE9R4geVf6EwK6dl60pXea9SZoqtsw7l i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Kmr4+JAMOiZRotehBXcg9Og+cGMsn/gMBPRnCqShMFlahUvAwGkl05Sy7tQulw9BqnPo dkcv5nPFwwmzhCALsTTolRHFM78rlMoEDskMa/Ej5coQJltUArGKbVk0UVb03i0Cpzc3Lf1K V9UIMkCX9YZgBnEY1HTH6KKStduwadCWLG97KSB5xRGs0tcaJP81TtixuaKJc0S7xKql6+3b AMNutkhPrQeb65bTq9gWxAJwmaL73afRIG0QqD9sTv9Ez3CvdONz+kR2nmGA+ilLJgLehTTf 48csIvBNgfdRumZbb7sieWyff/8hEQk=
- In-reply-to: <C0CF1A8E-FD75-4024-BA4B-0C4D8880FB8D@dana.is>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Openpgp: preference=signencrypt
- References: <C0CF1A8E-FD75-4024-BA4B-0C4D8880FB8D@dana.is>
Found a strange issue with traps and 'exit'.
Test script:
trap 'printf $1; exit; printf $2' USR1
fn() {
printf 1
kill -s usr1 $$
printf 2
}
printf 0
fn A B
printf 3
Every shell outputs 01A, except zsh, which outputs 01A2.
This means the execution of the fn() function is not interrupted. The
USR1 trap executes 'exit' and does not execute the rest of the trap
action, but instead of exiting the shell, zsh continues to execute fn()
and then exits.
Confirmed down to zsh 5.0.8 (didn't test earlier versions).
- M.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author