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: Tue, 13 Jan 2015 10:29:40 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Jan 12, 2015 at 11:50:56AM -0500, Chet Ramey wrote:
> On 1/12/15 9:55 AM, address@hidden wrote:
> > Configuration Information [Automatically generated, do not change]:
> > Machine: x86_64
> > OS: linux-gnu
> > Compiler: gcc -I/home/abuild/rpmbuild/BUILD/bash-4.3 
> > -L/home/abuild/rpmbuild/BUILD/bash-4.3/../readline-6.3
> > Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
> > -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-suse-linux-gnu' 
> > -DCONF_VENDOR='suse' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' 
> > -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -fmessage-length=0 
> > -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector 
> > -funwind-tables -fasynchronous-unwind-tables -g  -D_GNU_SOURCE 
> > -DRECYCLES_PIDS -Wall -g -Wuninitialized -Wextra -Wno-unprototyped-calls 
> > -Wno-switch-enum -Wno-unused-variable -Wno-unused-parameter 
> > -Wno-parentheses -ftree-loop-linear -pipe -DBNC382214=0 
> > -DMUST_UNBLOCK_CHLD=1 -DIMPORT_FUNCTIONS_DEF=0 -fprofile-use
> > uname output: Linux d136 3.15.0-rc7-3-desktop #1 SMP PREEMPT Wed May 28 
> > 15:39:51 UTC 2014 (96f5b60) x86_64 x86_64 x86_64 GNU/Linux
> > Machine Type: x86_64-suse-linux-gnu
> > 
> > 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 (address@hidden, wpid=19175) at jobs.c:3235
#2  0x000000000042c6da in wait_for (address@hidden) at jobs.c:2496
#3  0x00000000004302e1 in command_substitute (address@hidden "dirname_int 
$link", 
    address@hidden) at subst.c:5534
#4  0x00000000004704db in param_expand (address@hidden "$(dirname_int $link)", 
    address@hidden, address@hidden, address@hidden, 
    address@hidden, 
    address@hidden, 
    address@hidden, pflags=0) at subst.c:7970
#5  0x0000000000471123 in expand_word_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, 
    address@hidden) at subst.c:8393
#6  0x000000000047130f in expand_word_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, 
    address@hidden) at subst.c:8548
#7  0x0000000000472daf in call_expand_word_internal (e=0x0, c=0x0, i=0, q=0, 
w=0x7fff39f91120) at subst.c:3299
#8  expand_string_assignment (address@hidden "\"$(dirname_int $link)\"", 
address@hidden)
    at subst.c:3387
#9  0x0000000000473110 in expand_string_if_necessary (string=<optimized out>, 
    address@hidden "\"$(dirname_int $link)\"", address@hidden, 
    address@hidden <expand_string_assignment>) at subst.c:3092
#10 0x0000000000473349 in do_assignment_internal (word=0x22cbbe0, expand=1) at 
subst.c:2823
#11 0x000000000047776a in do_word_assignment (flags=<optimized out>, 
word=<optimized out>) at subst.c:2912
#12 expand_word_list_internal (eflags=<optimized out>, list=<optimized out>) at 
subst.c:9669
#13 expand_words (list=0xffffffffffffffff) at subst.c:9280
#14 0x0000000000461093 in execute_simple_command (simple_command=0x22c1ed0, 
address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:4001
#15 0x00000000004629fc in execute_command_internal (command=0x22bc9e0, 
address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:788
#16 0x0000000000462ba6 in execute_connection (fds_to_close=0x22ccce0, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c0bd0) at execute_cmd.c:2497
#17 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#18 0x0000000000464d41 in execute_command (command=0x22c0bd0) at 
execute_cmd.c:391
#19 0x0000000000462b6a in execute_connection (fds_to_close=0x22cbf90, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c2500) at execute_cmd.c:2495
#20 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#21 0x0000000000464d41 in execute_command (command=0x22c2500) at 
execute_cmd.c:391
#22 0x0000000000462b6a in execute_connection (fds_to_close=0x22c9d90, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c2680) at execute_cmd.c:2495
#23 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#24 0x0000000000464d41 in execute_command (command=0x22c2680) at 
execute_cmd.c:391
#25 0x0000000000462b6a in execute_connection (fds_to_close=0x22c0770, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
---Type <return> to continue, or q <return> to quit---
    command=0x22c27a0) at execute_cmd.c:2495
#26 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#27 0x0000000000464d41 in execute_command (command=0x22c27a0) at 
execute_cmd.c:391
#28 0x0000000000462b6a in execute_connection (fds_to_close=0x22c06e0, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c28c0) at execute_cmd.c:2495
#29 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#30 0x0000000000464d41 in execute_command (command=0x22c28c0) at 
execute_cmd.c:391
#31 0x0000000000462b6a in execute_connection (fds_to_close=0x22c0560, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c29e0) at execute_cmd.c:2495
#32 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#33 0x0000000000464d41 in execute_command (command=0x22c29e0) at 
execute_cmd.c:391
#34 0x0000000000462b6a in execute_connection (fds_to_close=0x22c9d30, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c2ae0) at execute_cmd.c:2495
#35 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#36 0x0000000000464d41 in execute_command (command=0x22c2ae0) at 
execute_cmd.c:391
#37 0x0000000000462b6a in execute_connection (fds_to_close=0x22cc3f0, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c38b0) at execute_cmd.c:2495
#38 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#39 0x0000000000464d41 in execute_command (command=0x22c38b0) at 
execute_cmd.c:391
#40 0x0000000000462b6a in execute_connection (fds_to_close=0x22c03e0, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c3de0) at execute_cmd.c:2495
#41 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#42 0x0000000000464d41 in execute_command (command=0x22c3de0) at 
execute_cmd.c:391
#43 0x0000000000462b6a in execute_connection (fds_to_close=0x22ca230, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c5c90) at execute_cmd.c:2495
#44 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#45 0x0000000000464d41 in execute_command (command=0x22c5c90) at 
execute_cmd.c:391
#46 0x0000000000462b6a in execute_connection (fds_to_close=0x22b93f0, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c5da0) at execute_cmd.c:2495
#47 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#48 0x0000000000464d41 in execute_command (command=0x22c5da0) at 
execute_cmd.c:391
#49 0x0000000000462b6a in execute_connection (fds_to_close=0x22c5360, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c6440) at execute_cmd.c:2495
#50 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
---Type <return> to continue, or q <return> to quit---
    at execute_cmd.c:946
#51 0x0000000000464d41 in execute_command (command=0x22c6440) at 
execute_cmd.c:391
#52 0x0000000000462b6a in execute_connection (fds_to_close=0x22cd1d0, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c6540) at execute_cmd.c:2495
#53 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#54 0x0000000000464d41 in execute_command (command=0x22c6540) at 
execute_cmd.c:391
#55 0x0000000000462b6a in execute_connection (fds_to_close=0x22c0580, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c9770) at execute_cmd.c:2495
#56 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#57 0x0000000000464d41 in execute_command (command=0x22c9770) at 
execute_cmd.c:391
#58 0x0000000000462b6a in execute_connection (fds_to_close=0x22bbf10, 
pipe_out=-1, pipe_in=-1, asynchronous=0, 
    command=0x22c9cd0) at execute_cmd.c:2495
#59 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:946
#60 0x0000000000464d41 in execute_command (command=0x22c9cd0) at 
execute_cmd.c:391
#61 0x0000000000425367 in execute_while_or_until (while_command=0x22c9c20, 
address@hidden)
    at execute_cmd.c:3380
#62 0x0000000000464a2e in execute_while_command (while_command=<optimized out>) 
at execute_cmd.c:3326
#63 execute_command_internal (address@hidden, address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:886
#64 0x0000000000464d41 in execute_command (command=0x22c9d00) at 
execute_cmd.c:391
#65 0x000000000041cabe in reader_loop () at eval.c:160
#66 0x000000000041c793 in main (argc=3, argv=0x7fff39f92778, 
env=0x7fff39f92798) at shell.c:757

(gdb) bt
#0  0x00007f530818a65c in waitpid () from /lib64/libc.so.6
#1  0x000000000042b233 in waitchld (address@hidden, wpid=19064) at jobs.c:3235
#2  0x000000000042c6da in wait_for (pid=19064) at jobs.c:2496
#3  0x0000000000464339 in execute_command_internal (command=0x22ca360, 
address@hidden, 
    address@hidden, address@hidden, address@hidden)
    at execute_cmd.c:830
#4  0x00000000004860c2 in parse_and_execute (
    address@hidden "find . -type l -printf '%p|%h|%l\\n' 2>/dev/null", 
    address@hidden "process substitution", address@hidden) at evalstring.c:388
#5  0x00000000004728d4 in process_substitute (open_for_read_in_child=0, 
    string=0x22ca4f0 "find . -type l -printf '%p|%h|%l\\n' 2>/dev/null") at 
subst.c:5214
#6  expand_word_internal (word=<optimized out>, address@hidden, address@hidden, 
    address@hidden, 
    address@hidden) at subst.c:8273
#7  0x00000000004737db in shell_expand_word_list (tlist=0x22c9f80, 
eflags=<optimized out>) at subst.c:9581
#8  0x0000000000477abe in expand_word_list_internal (eflags=<optimized out>, 
list=<optimized out>)
    at subst.c:9701
#9  expand_words_no_vars (list=0xffffffffffffffff, address@hidden) at 
subst.c:9289
#10 0x000000000043f605 in redirection_expand (address@hidden) at redir.c:290
#11 0x000000000043f906 in do_redirection_internal (address@hidden, 
address@hidden)
    at redir.c:830
#12 0x000000000047b571 in do_redirections (list=<optimized out>, 
address@hidden) at redir.c:233
#13 0x0000000000462ff9 in execute_command_internal (address@hidden, 
    address@hidden, address@hidden, address@hidden, 
    address@hidden) at execute_cmd.c:723
#14 0x0000000000464d41 in execute_command (command=0x22c9d00) at 
execute_cmd.c:391
#15 0x000000000041cabe in reader_loop () at eval.c:160
#16 0x000000000041c793 in main (argc=3, argv=0x7fff39f92778, 
env=0x7fff39f92798) at shell.c:757

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]