bug-bash
[Top][All Lists]
Advanced

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

Re: [bug-bash] Named fifo's causing hanging bash scripts


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

On Fri, Jan 16, 2015 at 09:22:36AM -0500, Chet Ramey wrote:
> On 1/13/15 4:29 AM, Dr. Werner Fink 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()
> >>
> >> And when you attach to one of the hanging bash processes using gdb, what
> >> does the stack traceback look like?
> > 
> > Yes (and sorry for the wrong email address as this was done on a clean 
> > virtual sysstem)
> > 
> > there are two hanging bash processes together with the find command:
> > 
> > werner   19062  0.8  0.0  11864  2868 ttyS0    S+   10:21   0:00 bash -x 
> > /tmp/brp-25-symlink
> > werner   19063  0.0  0.0  11860  1920 ttyS0    S+   10:21   0:00 bash -x 
> > /tmp/brp-25-symlink
> > werner   19064  0.2  0.0  16684  2516 ttyS0    S+   10:21   0:00 find . 
> > -type l -printf %p|%h|%l n
> > 
> > the gdb -p 19062 and gdb -p 19063 show
> > 
> > (gdb) bt
> > #0  0x00007f530818a65c in waitpid () from /lib64/libc.so.6
> > #1  0x000000000042b233 in waitchld (block=block@entry=1, wpid=19175) at 
> > jobs.c:3235
> > #2  0x000000000042c6da in wait_for (pid=pid@entry=19175) at jobs.c:2496
> 
> What do ps and gdb tell you about pid 19175 (and the corresponding pid in
> the call to waitchld in the other traceback)?  Running, terminated, reaped,
> other?

  d136:~ # ps 10942
    PID TTY      STAT   TIME COMMAND
  d136:~ #

... the process does not exists anymore. I guess that this could belong to
the sed commands of the script.  The other thread is showing

  d136: # ps 10922
    PID TTY      STAT   TIME COMMAND
  13177 pts/1    S+     0:00 find . -type l -printf %p|%h|%l n

and the backtrace shows here

 0x00007fccae8d4860 in __write_nocancel () from /lib64/libc.so.6
 #0  0x00007fccae8d4860 in __write_nocancel () from /lib64/libc.so.6
 #1  0x00007fccae86f6b3 in _IO_new_file_write () from /lib64/libc.so.6
 #2  0x00007fccae86ed73 in new_do_write () from /lib64/libc.so.6
 #3  0x00007fccae8704e5 in __GI__IO_do_write () from /lib64/libc.so.6
 #4  0x00007fccae86fbe1 in __GI__IO_file_xsputn () from /lib64/libc.so.6
 #5  0x00007fccae8416e0 in vfprintf () from /lib64/libc.so.6
 #6  0x00007fccae8eec05 in __fprintf_chk () from /lib64/libc.so.6
 #7  0x00000000004106d5 in ?? ()
 #8  0x000000000040a11b in ?? ()
 #9  0x000000000040afa9 in ?? ()
 #10 0x000000000040b0a6 in ?? ()
 #11 0x0000000000409bfe in ?? ()
 #12 0x0000000000409bfe in ?? ()
 #13 0x0000000000404199 in ?? ()
 #14 0x0000000000403911 in ?? ()
 #15 0x00007fccae81cb05 in __libc_start_main () from /lib64/libc.so.6
 #16 0x00000000004039dd in ?? ()

which IMHO could be related that output of find is not read anymore(?)


> 
> Chet

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]