Bug 13191

Summary: zcat multiple gz files will generate zombie processes
Product: Busybox Reporter: xiechengliang <xiechengliang1>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs, vda.linux, xiechengliang1
Priority: P5    
Version: 1.31.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:
Attachments: zcat multiple gz files will generate zombie processes

Description xiechengliang 2020-09-09 13:29:06 UTC
Created attachment 8581 [details]
zcat multiple gz files will generate zombie processes

When I use zcat to view the contents of several compressed packages, these come from the community,some zombie processes will be generated before the zcat task is completed。
For example:
  $ zcat attr-2.4.48.tar.gz iproute2-5.5.0.tar.gz libffi-3.3.tar.gz

 I use the ps command to view the process status, the result is as follows:
  $ ps -ef | grep zcat
  root       12583    9689  0 20:50 pts/5    00:00:00 zcat attr-2.4.48.tar.gz iproute2-5.5.0.tar.gz libffi-3.3.tar.gz
  root       12584   12583  0 20:50 pts/5    00:00:00 [zcat] <defunct>
  root       12587   12583  0 20:50 pts/5    00:00:00 [zcat] <defunct>

  When the zcat task ends, the zombie process is recycled, when the compressed package is relatively large, the zombie process will exist for a period of time.

  When viewing each compressed package, will fork a child, but the parent process does not reclaim resources after the child ends. 
  Should the resource be reclaimed when the child process exits?The attachment provides a repair plan for reference.
Comment 1 Denys Vlasenko 2020-10-07 14:25:38 UTC
Each zombie takes only ~12 kb on x86-64, irrespective of its memory use prior to death. I don't feel it's worth fixing.
Dio you disagree?
Comment 2 xiechengliang 2020-10-19 13:40:40 UTC
(In reply to Denys Vlasenko from comment #1)
Although the impact is small, it is a problem.