bug-bash
[Top][All Lists]
Advanced

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

Re: Named fifo's causing hanging bash scripts


From: Dr. Werner Fink
Subject: Re: Named fifo's causing hanging bash scripts
Date: Fri, 16 Jan 2015 16:25:37 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Jan 16, 2015 at 09:09:25AM -0500, Chet Ramey wrote:
> On 1/12/15 9:55 AM, werner@linux-8jdz.site wrote:
> 
> > Bash Version: 4.3
> > Patch Level: 33
> > Release Status: release
> > 
> > Description:
> >         Named fifo's causing hanging bash scripts like
> > 
> >         while IFS="|" read a b c ; do
> >           [shell code]
> >         done < <(shell code)
> > 
> >         can cause random hangs of the bash.    An strace shows that the bash
> >         stays in wait4()
> 
> I can't reproduce this.  I spun up a VM running OpenSUSE 13 and ran the
> attached script against a version of bash-4.3.33 that was modified to use
> FIFOs instead of /dev/fd.  There were no hangs in any of about 30 runs.

Hmmm ... what I see is

  werner   10920  0.0  0.0  11860  2876 pts/1    S+   15:59   0:00 bash 
/tmp/brp-25-symlink
  werner   10921  0.0  0.0  11856  1844 pts/1    S+   15:59   0:00 bash 
/tmp/brp-25-symlink
  werner   10922  0.0  0.0  16684  2476 pts/1    S+   15:59   0:00 find . -type 
l -printf %p|%h|%l n

  d136:~ # ll /proc/10920/fd
  total 0
  lr-x------ 1 werner suse 64 Jan 16 15:59 0 -> pipe:[124428]
  lrwx------ 1 werner suse 64 Jan 16 15:59 1 -> /dev/pts/1
  lrwx------ 1 werner suse 64 Jan 16 15:59 10 -> /dev/pts/1
  lrwx------ 1 werner suse 64 Jan 16 15:59 2 -> /dev/pts/1
  lr-x------ 1 werner suse 64 Jan 16 15:59 255 -> /tmp/brp-25-symlink
  d136:~ # ll /proc/10921/fd
  total 0
  lrwx------ 1 werner suse 64 Jan 16 15:59 0 -> /dev/pts/1
  l-wx------ 1 werner suse 64 Jan 16 15:59 1 -> pipe:[124428]
  lrwx------ 1 werner suse 64 Jan 16 15:59 2 -> /dev/pts/1

... but in the build there is

  [  131s] checking for mkfifo... yes

  [  150s] execute_cmd.c: In function 'execute_command_internal':
  [  150s] execute_cmd.c:1034:12: warning: 'ofifo_list' may be used 
uninitialized in this function [-Wmaybe-uninitialized]
  [  150s]        free ((void *)ofifo_list);
  [  150s]             ^

and currently the bash43 is not usable for the OBS here. Also my personal
chrootx script using <() for fiddling with xauth hangs upto Ctrl-C.

Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr

Attachment: signature.asc
Description: Digital signature


reply via email to

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