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


bug #32268: xargs causing zobmie processes

Submitted by:  None
Submitted on:  Thu 27 Jan 2011 10:21:00 PM UTC  
Category:  xargs Severity:  3 - Normal
Item Group:  Wrong result Status:  None
Privacy:  Public Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  4.4.2
Fixed Release:  None

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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>
Project 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.



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

Attach Files:

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)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.3