bugfindutils - Bugs: bug #32268, xargs causing zobmie processes

 
 

bug #32268: xargs causing zobmie processes

Submitter:  None
Submitted:  Thu 27 Jan 2011 10:21:00 PM UTC
   
 
Category:  xargs Severity:  3 - Normal
Item Group:  Wrong result Status:  Working as Intended
Privacy:  Public Assigned to:  jay
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.4.2
Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 02 Apr 2011 07:33:45 PM UTC, comment #1: 

This happens because xargs does not call waitpid while it is executing read_line or read_string.   That is, it reads the input synchronously and only reaps children when it's read an argument.

The number of zombies should not exceed the argument given to -P.  That is, any given child process should either be running or a not-yet-reaped zombie.   For -P 0 of course, there's no limit to the number of running children or zombies.

James Youngman <jay>
Group administrator
Thu 27 Jan 2011 10:21:00 PM UTC, original submission:  

I have a strange conundrum. It may not even be a bug.

How to replicate:

1. Create a FIFO:
mknod testqueue p
2. "tail" the FIFO, piping the contents to xargs (running "sleep", a maximum of 5 procs):
tail -f testqueue | xargs -n 1 -P 5 sleep
3. In a seperate console, terminal, echo numbers into the testqueue fifo:
echo "1" >> testqueue
echo "1" >> testqueue
echo "1" >> testqueue
echo "1" >> testqueue
echo "1" >> testqueue


4. Check the process listing after the sleep processes have finished:
troy.rose@ubuntu:~$ ps auxww | grep sleep
1000       512  0.0  0.1   3508   636 pts/2    S+   17:16   0:00 xargs -r -n 1 -P 5 sleep
1000       602  0.0  0.0      0     0 pts/2    Z+   17:17   0:00 [sleep] <defunct>
1000       603  0.0  0.0      0     0 pts/2    Z+   17:17   0:00 [sleep] <defunct>
1000       604  0.0  0.0      0     0 pts/2    Z+   17:17   0:00 [sleep] <defunct>
1000       606  0.0  0.0      0     0 pts/2    Z+   17:17   0:00 [sleep] <defunct>
1000       607  0.0  0.0      0     0 pts/2    Z+   17:17   0:00 [sleep] <defunct>
1000       617  0.0  0.1   3328   864 pts/0    S+   17:17   0:00 grep --color=auto sleep

Looks like these processes have all zombied out. Xargs seems to not be handling this correctly?

My original reason for doing all this was to create a rudimentary, minimalistic shell based process queue for batching up jobs, but if I'm getting zombies, I'm questioning whether or not this is my fault or a bug/issue/problem with xargs.

I'm using ubuntu 10.4.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jay (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-09-01 jay StatusNone Working as Intended
        Assigned toNone jay
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code