Package: bash
Version: 4.3-11+b1
Severity: normal

Dear Maintainer,

the behavior of bash to handle signals of the built-in "read" command
has changed against bash V4.2.

The following tiny script shows the issue:

----------------- Script begin ------------------
#!/bin/bash

FIFO=myfifo
rm -f $FIFO
mkfifo $FIFO

myhandler()
{
    echo "myhandler called"
    trap - INT
    kill -s INT $$
}

echo "Pid is $$"
trap myhandler INT

while [ "1" ]; do
    read a b < $FIFO
    echo "Read $a $b"
done
----------------- Script end ------------------

This script cannot be stopped by CTRL-C as long as "read" is blocking.
When I change the line
    read a b < $FIFO
into
    read a b
it works fine. Even if I kill the process externally via "kill -INT <pid>"

With bash 4.2.37 (part of Debian 7.8) this worked smoothly.
CTRL-C always stopped the execution of the script.

Is there any option I have to set or any workaround to make the bash script 
behave as expected?

When I use "dash" instead of "bash" it is working fine.
However, as I want to use some extended bash features I'd like to stay
with bash...


Thanks for any feedback on this issue.

Regards

Mathias


-- System Information:
Debian Release: 8.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.18.13-rt10-2 (SMP w/8 CPU cores; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages bash depends on:
ii  base-files   8+deb8u1
ii  dash         0.5.7-4+b1
ii  debianutils  4.4+b1
ii  libc6        2.19-18
ii  libncurses5  5.9+20140913-1+b1
ii  libtinfo5    5.9+20140913-1+b1

Versions of packages bash recommends:
ii  bash-completion  1:2.1-4

Versions of packages bash suggests:
pn  bash-doc  <none>

-- no debconf information


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to