#390433 dash: does not execute EXIT trap if shell is killed

Package:
dash
Source:
dash
Description:
POSIX-compliant shell
Submitter:
Martin Dickopp
Date:
2025-08-21 07:41:02 UTC
Severity:
important
Tags:
#390433#5
Date:
2006-10-01 09:10:55 UTC
From:
To:
Hi,

If I run the this two line script:

  trap 'echo EXIT trap executed' EXIT
  kill -HUP $$

I would expect it to display "EXIT trap executed", but it does not
display anything.

(If I add a HUP trap, both the HUP trap and the EXIT trap are executed.)

Cheers,
Martin

#390433#8
Date:
2008-05-28 01:49:24 UTC
From:
To:
user debian-release@lists.debian.org
usertags 390433 + goal-dash
thanks

I am adding this bug to the dash as /bin/sh RG because IMHO it is relevant.
This bug has actually affected some scripts I wrote and is kind-of annoying.

Thanks,

#390433#13
Date:
2008-06-11 02:59:26 UTC
From:
To:
tags 390433 + patch
thanks

Patch attached.


Regards,

#390433#22
Date:
2008-08-01 06:00:02 UTC
From:
To:
Chris Lamb wrote:

Hi Gerrit,

You marked this bug as "forwarded" but I don't see anything on the mailing
list about it; should I just look harder?


Regards,

#390433#27
Date:
2008-10-19 15:57:34 UTC
From:
To:
Chris Lamb wrote:

Any movement on this?


Regards,

#390433#32
Date:
2008-10-19 16:09:40 UTC
From:
To:
severity 390433 important
thanks

This is a pretty bad bug for those of us who are relaying on correct
trap handling, please apply patch, thanks.

#390433#39
Date:
2009-02-12 08:47:03 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
dash, which is due to be installed in the Debian FTP archive:

ash_0.5.5.1-1_all.deb
  to pool/main/d/dash/ash_0.5.5.1-1_all.deb
dash_0.5.5.1-1.diff.gz
  to pool/main/d/dash/dash_0.5.5.1-1.diff.gz
dash_0.5.5.1-1.dsc
  to pool/main/d/dash/dash_0.5.5.1-1.dsc
dash_0.5.5.1.orig.tar.gz
  to pool/main/d/dash/dash_0.5.5.1.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 390433@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Gerrit Pape <pape@smarden.org> (supplier of updated dash package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
Format: 1.8
Date: Wed, 11 Feb 2009 01:55:05 +0000
Source: dash
Binary: dash ash
Architecture: all source
Version: 0.5.5.1-1
Distribution: unstable
Urgency: low
Maintainer: Gerrit Pape <pape@smarden.org>
Changed-By: Gerrit Pape <pape@smarden.org>
Description:
 ash        - compatibility package for dash
 dash       - POSIX-compliant shell
Closes: 390433 476422 493301 499838 513689
Changes:
 dash (0.5.5.1-1) unstable; urgency=low
 .
   * new upstream release.
     * builds again with DEB_BUILD_OPTIONS=diet (closes: #493301).
   * debian/diff/*.diff: remove; obsolete.
   * debian/po/es.po: [INTL:es] Spanish debconf template translation
     for dash (thx Francisco Javier Cuadrado, closes: #513689).
   * debian/diff/0001--SHELL-execute-EXIT-trap-if-the-shell-...diff:
     new; [SHELL] execute EXIT trap if the shell is killed through a
     signal (thx Chris Lamb for the patch, closes: #390433).
   * debian/diff/0002--MAN-rename-sh-to-dash-update-DESCRIPTION...diff:
     new; [MAN] rename sh to dash, update DESCRIPTION and HISTORY (thx
     jaalto, closes: #499838).
   * debian/diff/0003--SHELL-print-n-upon-EOF-CTRL-D-when-run-...diff:
     new; [SHELL] print \n upon EOF (CTRL-D) when run interactively
     (closes: #476422).
Checksums-Sha1:
 d0ebe7f294b92790a3152719c356c5cce11f68a8 1018 dash_0.5.5.1-1.dsc
 fd73f0a34477eaf8bacc36beee75d94551954a61 208094 dash_0.5.5.1.orig.tar.gz
 0bef12c0b838940e984d9b12896dd56d3a2ea61a 31074 dash_0.5.5.1-1.diff.gz
 65d69700eee8d5546915b08e455c50052593e50c 22402 ash_0.5.5.1-1_all.deb
Checksums-Sha256:
 2506939775e713608c1f9fd5c4259aba3a0452145b9f3b063cd14ebbc7e280fe 1018 dash_0.5.5.1-1.dsc
 1c6717a1014c73aa16bc78a4767f1e00b40ff2a01a6c2cf2cce9a5335c24493f 208094 dash_0.5.5.1.orig.tar.gz
 4189251bd0cd392293a55e3af76288c6225ebe802db9c61ae62d903bedd8fa28 31074 dash_0.5.5.1-1.diff.gz
 4f8646094b157aab51f05d7dec2625c148fd405c41cca561bbf8661a1152ab54 22402 ash_0.5.5.1-1_all.deb
Files:
 53095b377694a0c44bc9d6487e736197 1018 shells optional dash_0.5.5.1-1.dsc
 7ac832b440b91f5a52cf8eb68e172616 208094 shells optional dash_0.5.5.1.orig.tar.gz
 81da93db805d275a97db2bcea9872fb9 31074 shells optional dash_0.5.5.1-1.diff.gz
 0cd8345c1bfd6240e74045a8ef00dae7 22402 shells optional ash_0.5.5.1-1_all.deb
iD8DBQFJk+CBGJoyQbxwpv8RAtpVAJ9zzi+O7nQhuJduaoe1yzbW6Dgz4ACcCYmf
fGTd+h+QedL3VSBQO6ktpfM=
=fQoU
-----END PGP SIGNATURE-----

#390433#48
Date:
2009-02-16 13:28:50 UTC
From:
To:
Hi, I got no response from upstream yet.  I applied the patch to
0.5.5.1-1, but it unfortunately causes severe problems (#515229,
#515064), so I removed it again in 0.5.5.1-2.

Regards, Gerrit.

#390433#53
Date:
2009-02-16 13:37:13 UTC
From:
To:
Gerrit Pape wrote:

I was never particularly confident in it, hence my desire to see
upstream comment on it.


Regards,

#390433#64
Date:
2011-10-18 19:58:18 UTC
From:
To:
I just was bitten by this. Is there a workaround?
#390433#69
Date:
2011-10-18 22:05:14 UTC
From:
To:
Hi,

W. Martin Borgert wrote:
fix its problems, I guess.

Good luck,
Jonathan

[1]
Patch: http://download.gmane.org/gmane.comp.shells.dash/106/107
Discussion: http://thread.gmane.org/gmane.comp.shells.dash/106
See the dash website for basics:
http://gondor.apana.org.au/~herbert/dash/

#390433#78
Date:
2017-04-01 06:09:17 UTC
From:
To:
Dear Customer,

Please check your package delivery details attached!

FedEx
-----BEGIN PGP PUBLIC KEY BLOCK----- 1ZIUw/4maOTXnTOD5p8vdKi/r2lbQaO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