bugmake - Bugs: bug #15502, "make -j" does not cope...

 
 

bug #15502: "make -j" does not cope with EAGAIN in vfork

Submitter:  None
Submitted:  Sat 21 Jan 2006 10:20:02 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.81 Operating System:  POSIX-Based
Fixed Release:  4.0 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 09 Oct 2013 05:03:10 AM UTC, comment #2: 

In the next release we use fork() not vfork() and from what I can tell the code definitely considers a failure to fork to cause the target to be marked failed.

However, I can't seem to reproduce this problem.  If I set my ulimit to 6 (on a basic login) then it all works, but if I set it to 5 then I get a failure in the shell, not make.  Still I think this is fixed; if not please add a comment.


$ ./make -f mkf4
--no-print-directory -- INC=yes
ONE
/bin/sh: Cannot fork
1.inc:1: recipe for target '1' failed
make[1]: *** [1] Error 2
mkf4:1: recipe for target 'recurse' failed
make: *** [recurse] Error 2


Paul D. Smith <psmith>
Group administrator
  Spam posted by sevanath
Sat 21 Jan 2006 10:20:02 PM UTC, original submission:  

When the limit on the number of processes is reached, "make -j" still tries to launch additional processes.  This causes vfork to fail with EAGAIN, but the target whose commands failed in this way are neither redone nor marked with a clear error message.

Here's a transcript of a session from a Debian GNU/Linux box with Make 3.81beta4 (it might be necessary to play with the argument to "ulimit -u" to reproduce this, depending on the number of other processes that run under the user's UID):

    eliz@fencepost:~$ cat mkf4
    recurse: ; @$(MAKE) --no-print-directory -f mkf4 INC=yes all
    all: 0 1 2; @echo success

    0: ; @echo $(MAKEFLAGS)

    INC = no
    ifeq ($(INC),yes)
    -include 1.inc 2.inc
    endif

    1.inc: ; @echo ONE.inc; sleep 2; echo TWO.inc; echo '1: ; @echo ONE; sleep 2; echo TWO' > $@
    2.inc: ; @sleep 1; echo THREE.inc; echo '2: ; @sleep 1; echo THREE' > $@
    eliz@fencepost:~$ make -j -f mkf4
    --no-print-directory -j -- INC=yes
    ONE
    THREE
    TWO
    success
    eliz@fencepost:~$ ulimit -S -u 9
    eliz@fencepost:~$ make -j -f mkf4
    make[1]: vfork: Resource temporarily unavailable
    --no-print-directory -j -- INC=yes
    ONE
    TWO

As you see, after limiting the number of jobs, the commands for 2.inc are not run because vfork fails, but Make doesn't say  anything about failing to remake the target.

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 psmith (Posted a comment)
  • -email is unavailable- added by sevanath (Posted a comment)
  •  

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-09 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Component Version4.0 3.81
        Fixed ReleaseNone 4.0

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code