Package: mksh
Version: 59c-9+b2
Severity: normal

Consider the following command:

  mksh -c 'trap "" INT; trap; ( sleep 3; ); echo $?'

If I hit Ctrl-C, the sleep is interrupted immediately, with
exit status 130, corresponding to a SIGINT:

$ mksh -c 'trap "" INT; trap; ( sleep 3; ); echo $?'
trap -- '' INT
^C130

This is incorrect, because SIGINT should be ignored.

This issue disappears when the subshell has several commands:

$ mksh -c 'trap "" INT; trap; ( :; sleep 3; ); echo $?'
trap -- '' INT
^C0

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-security'), (500, 
'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-8-amd64 (SMP w/12 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=POSIX, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages mksh depends on:
ii  libc6  2.31-17

Versions of packages mksh recommends:
ii  ed  1.17-1

mksh suggests no packages.

-- no debconf information

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to