Bug 1622892

Summary: zsh leaves stale zombies with construction find | while read f ...
Product: Red Hat Enterprise Linux 6 Reporter: Filip Krska <fkrska>
Component: zshAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Jakub Heger <jheger>
Severity: medium Docs Contact:
Priority: urgent    
Version: 6.10CC: jheger, jreznik, kdudka, lmanasko, svashisht
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: zsh-4.3.11-9.el6_10 Doc Type: Release Note
Doc Text:
Previously, the zsh interpreter missed the SIGCHLD signal while waiting for a job to complete. As a consequence, zsh became unresponsive instead of continuing with execution of the script. With this update, signals are queued while the critical section of the job waiting code is executed. As a result, zsh properly waits for jobs to complete and does not hang indefinitely anymore.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-09 15:50:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1198671    
Bug Blocks:    
Attachments:
Description Flags
ci/128bf385 adapted to el6 kdudka: review+

Description Filip Krska 2018-08-28 08:02:34 UTC
Description of problem:

`find` process intermittently end in state

0 Z 700       8114 25341  0  85   5 -     0 do_exi May10 ?        00:00:00 [find] <defunct>

when construction

find ... | while read f; do listing_files2+=( "${f}" ); done

is used.

Version-Release number of selected component (if applicable):

zsh-4.3.11-8.el6

How reproducible:

Intermittently in production

Steps to Reproduce:
1. execute scripts containing construct

find ... | while read f; do listing_files2+=( "${f}" ); done

heavily

Actual results:

0 Z 700       8114 25341  0  85   5 -     0 do_exi May10 ?        00:00:00 [find] <defunct>

observed several times a day

Expected results:

no zombies

Additional info:

Not observed with zsh-5.0.2-19.el7

Backtrace pattern:

#0  0x0000003fb8c3281a in do_sigsuspend (set=0x7fff1485a950) at ../sysdeps/unix/sysv/linux/sigsuspend.c:63
63	  return INLINE_SYSCALL (rt_sigsuspend, 2, CHECK_SIGSET (set), _NSIG / 8);
(gdb) bt
#0  0x0000003fb8c3281a in do_sigsuspend (set=0x7fff1485a950) at ../sysdeps/unix/sysv/linux/sigsuspend.c:63
#1  __sigsuspend (set=0x7fff1485a950) at ../sysdeps/unix/sysv/linux/sigsuspend.c:74
#2  0x000000000047696c in signal_suspend (sig=<value optimized out>, wait_cmd=0) at signals.c:373
#3  0x0000000000447b4f in zwaitjob (job=<value optimized out>, wait_cmd=0) at jobs.c:1300
#4  0x0000000000447d06 in waitjobs () at jobs.c:1345
#5  0x000000000042c12f in execpline (state=<value optimized out>, slcode=<value optimized out>, how=<value optimized out>, last1=0)
    at exec.c:1500
#6  0x000000000042cd67 in execlist (state=0x7fff1485bb90, dont_change_job=1, exiting=0) at exec.c:1207
#7  0x000000000044f29f in execfor (state=0x7fff1485bb90, do_exec=0) at loop.c:159
#8  0x000000000042a604 in execcmd (state=<value optimized out>, input=0, output=0, how=0, last1=2) at exec.c:3124
#9  0x000000000042b656 in execpline2 (state=0x7fff1485bb90, pcode=<value optimized out>, how=18, input=0, output=0, last1=0)
    at exec.c:1640
...
#53 0x000000000042ba18 in execpline (state=0x7fff1485f080, slcode=<value optimized out>, how=18, last1=0) at exec.c:1424
#54 0x000000000042cd67 in execlist (state=0x7fff1485f080, dont_change_job=0, exiting=0) at exec.c:1207
#55 0x000000000042d0b6 in execode (p=0x7f235c355510, dont_change_job=0, exiting=0, context=0x49287e "some_context") at exec.c:1025
#56 0x000000000043fac2 in loop (toplevel=1, justonce=0) at init.c:188
#57 0x0000000000441dfe in zsh_main (argc=<value optimized out>, argv=<value optimized out>) at init.c:1513
#58 0x0000003fb8c1ed1d in __libc_start_main (main=0x40de30 <main>, argc=3, ubp_av=0x7fff1485f468, init=<value optimized out>, 
    fini=<value optimized out>, rtld_fini=<value optimized out>, stack_end=0x7fff1485f458) at libc-start.c:226
---Type <return> to continue, or q <return> to quit---
#59 0x000000000040dd69 in _start ()

Theory (credit to kdudka++) is that it's missing https://sourceforge.net/p/zsh/code/ci/128bf385 patch in el6's zsh.

Comment 2 Filip Krska 2018-08-28 08:30:40 UTC
Created attachment 1479172 [details]
ci/128bf385 adapted to el6

Comment 3 Kamil Dudka 2018-08-28 08:31:53 UTC
I guess this bug is about zsh, switching the component...

Comment 14 errata-xmlrpc 2018-10-09 15:50:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:2897