bug-bash
[Top][All Lists]
Advanced

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

DEBUG trap breaks pipelines


From: lex
Subject: DEBUG trap breaks pipelines
Date: Tue, 24 Feb 2009 16:22:33 +0200 (EET)

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-redhat-linux-gnu' 
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib  -D_GNU_SOURCE  -O2 -g -pipe 
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m64 -mtune=generic
uname output: Linux fiber.upc.intranet 2.6.20-1.2320.fc5 #1 SMP Tue Jun 12 
18:50:49 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-redhat-linux-gnu

Bash Version: 3.1
Patch Level: 17
Release Status: release

Note: Configuration Information is irrelevant -- same bug in all 
versions(3.1-4.0 inclusive)/OSes(linux,tru64)/machines(alpha,i686,x86_64).

Description:
        {trap "/external/program" DEBUG} breaks pipelining in some ways. When 
trap is set:

        1. A | B pipeline sometimes(*) does not run(**) second part and hungs 
forever.
           sometimes SIGINT(Ctrl+C) revives it, and second part starts.
           (*) in my observation it depends on time, 'A' takes to complete -- 
"small" tasks does not triggers that behaviour.
           (**) trap for the "B" part is called, but not the command "B" itself
        2. A & B breaks job control
        3. (may be not a bug) "$_" no longer contains last arg.
        
Repeat-By:
        [1] ./bash --norc
        bash-4.0$ trap /bin/true DEBUG
        bash-4.0$ du -xk .. | sort
        #either works or hungs until Ctrl+C, depending on size of du's directory
        #ps shows 'du', but no 'sort'

        [2] ./bash --norc
        bash-4.0$ trap /bin/true DEBUG
        bash-4.0$ /bin/true & /bin/true
        [2] 16217
        [2]+  Done                    /bin/true
        bash-4.0$ jobs
        [1]   Done                    jobs
        bash-4.0$ jobs
        [1]   Done                    jobs





reply via email to

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