Package: ksh
Version: 93u+20120628-1
Severity: normal

Dear Maintainer,

With this script:

  $ cat <<EOF >sigtest.sh
  #!/bin/ksh
  function f {
  trap - INT
  sleep 2
  }
  trap '' INT
  f
  trap -p INT
  sleep 2
  EOF

the `trap -p INT' statement gives a strange result with non-printable chars, 
whether the f Korn-style function was interrupted or not by SIGINT.  It shows 
that the handler of SIGINT in the shell was modified by f; according to the 
manpage, that should not happen.  If the script is interrupted after f has 
returned, I get the error message:

  ^C./sig_test.sh[9]: <weird_data>: not found [No such file or directory]

The strange result can be for example ` új81'.  The fact that the script fails 
to execute any handler is certainly a bug.

Something not too surprising would be to have `trap - INT' inside a Korn 
function make the trap exit the function, as if no `trap '' INT' had been given 
before the call to f, which is what happens when the signal is not ignored.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (800, 'unstable'), (500, 'stable-updates'), (500, 'testing'), 
(500, 'stable'), (10, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 2.6.32-5-core2 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ksh depends on:
ii  libc6  2.13-35

ksh recommends no packages.

ksh suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to