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: xargsSeverity: 3 - Normal
Item Group: Wrong resultStatus: None
Privacy: PublicAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: OpenRelease: 4.4.2
Fixed Release: None

Add a New Comment (Rich MarkupRich 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.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup