On 2/28/14 2:48 AM, Moe Tunes wrote:

> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 4.3
> Patch Level: 0
> Release Status: release
> 
> Description:
>     Pipes stop working in this version when DEBUG is used with trap in an
> interactive shell

It turns out that this is Linux-specific only to the extent that Linux
requires process group synchronization.  One of the changes to trap
handling added a level of saving state that was redundant in the case of
the DEBUG trap, and that broke this synchronization.  I've attached a
patch that fixes the problem.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/
*** ../bash-4.3/trap.c	2014-02-05 10:03:21.000000000 -0500
--- trap.c	2014-02-28 09:51:43.000000000 -0500
***************
*** 921,925 ****
  
  #if defined (JOB_CONTROL)
!       save_pipeline (1);	/* XXX only provides one save level */
  #endif
  
--- 921,926 ----
  
  #if defined (JOB_CONTROL)
!       if (sig != DEBUG_TRAP)	/* run_debug_trap does this */
! 	save_pipeline (1);	/* XXX only provides one save level */
  #endif
  
***************
*** 941,945 ****
  
  #if defined (JOB_CONTROL)
!       restore_pipeline (1);
  #endif
  
--- 942,947 ----
  
  #if defined (JOB_CONTROL)
!       if (sig != DEBUG_TRAP)	/* run_debug_trap does this */
! 	restore_pipeline (1);
  #endif
  

Reply via email to