bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trapping signal does not work correctly on subsequent shell scripts


From: Nagy Tibor
Subject: trapping signal does not work correctly on subsequent shell scripts
Date: Tue, 29 Jun 2004 17:41:37 -0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux
Compiler: gcc -I/usr/src/packages/BUILD/bash-2.05
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux' -DCONF_MACHTYPE='i386-suse-linux'
-DCONF_VENDOR='suse' -DSHELL -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64
-I. -I/usr/include -I. -I./include -I./lib -I/usr/include -O2
-march=i486 -mcpu=i686 -D_GNU_SOURCE -Wall -pipe
uname output: Linux dell632 2.4.20 #4 SMP Fri Jan 10 12:07:00 CET 2003
i686 unknown
Machine Type: i386-suse-linux

Bash Version: 2.05
Patch Level: 0
Release Status: release

Description:

Something is wrong on trapping signal on subsequent shell scripts if
CTRL-C is pressed at the terminal.
IMPORTANT NOTE: The problem happens only on SMP environment!!!

Repeat-By:

Start the attached a.sh. It starts b.sh, which starts c.sh, which starts
sleep 1000. Send a SIGQUIT signal to a.sh. The following output is seen:

ntibor@dell632:~/tmp/signal(1076)>./a.sh
a.sh(21704): waiting for b.sh(21705)...
b.sh(21705): waiting for c.sh(21706)...
c.sh(21706): waiting for sleep(21707)...# kill 21704 at this point
a.sh: signal received(kill 21705)
b.sh: signal received(kill 21706)
c.sh: signal received(kill 21707)
ntibor@dell632:~/tmp/signal(1077)>

This the expected situation. But if I press simply CTRL-C, I get the
following output:

ntibor@dell632:~/tmp/signal(1077)>./a.sh
a.sh(23707): waiting for b.sh(23708)...
b.sh(23708): waiting for c.sh(23709)...
c.sh(23709): waiting for sleep(23710)...
a.sh: signal received(kill 23708)
ntibor@dell632:~/tmp/signal(1078)>

I do not understand why only a.sh prints "signal received" text.
Furthermore c.sh and the sleep command are kept running.




Attachment: a.sh
Description: Bourne shell script

Attachment: b.sh
Description: Bourne shell script

Attachment: c.sh
Description: Bourne shell script


reply via email to

[Prev in Thread] Current Thread [Next in Thread]