bugmake - Bugs: bug #58232, FD_CLOEXEC not initialized on...

 
 

bug #58232: FD_CLOEXEC not initialized on jobserver pipe for recursive make invocations

Submitter:  Kevin Buettner <kevinbuettner>
Submitted:  Thu 23 Apr 2020 09:58:58 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  4.3 Operating System:  POSIX-Based
Fixed Release:  4.4 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 03 May 2020 06:24:47 PM UTC, comment #1: 

Fix applied, thanks!

Paul D. Smith <psmith>
Group administrator
Thu 23 Apr 2020 09:58:58 PM UTC, original submission:  

In make version 4.3, there are circumstances in which the jobserver pipe FDs are not closed when invoking a job that's not a recursive make invocation.  This happens when invoking make from the top-level make and then starting another (non-make) job.

I have a test case which causes "make -j4" to hang on 4.3, but not on 4.2.1.  Download the attachment make-cloexec-bug.tgz, and do the following:

[kevinb-fedora@rawhide-1 ~]$ tar xf make-cloexec-bug.tgz
[kevinb-fedora@rawhide-1 ~]$ cd make-cloexec-bug
[kevinb-fedora@rawhide-1 make-cloexec-bug]$ make -j4
sleep 2; echo a
sleep 1; echo b
make -C looper
make[1]: Entering directory '/home/kevinb-fedora/make-cloexec-bug/looper'
gcc -o looper looper.c
./looper
In looper; do...
kill -KILL 2360472
...when done.
make[1]: Leaving directory '/home/kevinb-fedora/make-cloexec-bug/looper'
b
a
^C
[kevinb-fedora@rawhide-1 make-cloexec-bug]$ make --version
GNU Make 4.3
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[kevinb-fedora@rawhide-1 make-cloexec-bug]$ kill -KILL 2360472

Note that I needed to interrupt the "make -j4" invocation with Ctrl-C in order to get back to the shell.

This problem occurs for me on current Fedora rawhide using make-4.3-1.fc33.x86_64, but I have also reproduced it using make built from git sources; "make --version" shows 4.3.90 for the git version.

---

Here's what a successful / non-buggy run looks like when using make 4.2.1 on Fedora 31:

[kevinb-fedora@f31-1 ~]$ tar xf make-cloexec-bug.tgz
[kevinb-fedora@f31-1 ~]$ cd make-cloexec-bug
[kevinb-fedora@f31-1 make-cloexec-bug]$ make -j4
sleep 2; echo a
sleep 1; echo b
make -C looper
make[1]: Entering directory '/home/kevinb-fedora/make-cloexec-bug/looper'
gcc -o looper looper.c
./looper
In looper; do...
kill -KILL 814945
...when done.
make[1]: Leaving directory '/home/kevinb-fedora/make-cloexec-bug/looper'
b
a
[kevinb-fedora@f31-1 make-cloexec-bug]$ make --version
GNU Make 4.2.1
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[kevinb-fedora@f31-1 make-cloexec-bug]$ kill -KILL 814945

Note that I did NOT need to interrupt make with Ctrl-C in this run.

I have a patch for this bug.  I'll attach/upload it after the bug is submitted.  (I want to be able to put the bug ID into the commit log.)

Kevin Buettner <kevinbuettner>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #48916:  bug58232.patch added by kevinbuettner (2KiB - text/x-patch - Fix for FD_CLOEXEC bug.)
file #48915:  make-cloexec-bug.tgz added by kevinbuettner (559B - application/x-compressed-tar)

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2020-05-03 psmith StatusNone Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.4
    2020-04-23 kevinbuettner Attached File- Added bug58232.patch, #48916
    2020-04-23 kevinbuettner Attached File- Added make-cloexec-bug.tgz, #48915

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code