Bug 1827850 - FD_CLOEXEC not initialized on jobserver pipe for recursive make invocations
Summary: FD_CLOEXEC not initialized on jobserver pipe for recursive make invocations
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: make
Version: 33
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: DJ Delorie
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-24 22:50 UTC by Kevin Buettner
Modified: 2021-11-30 16:19 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-11-30 16:19:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Test case demonstrating the make FD_CLOEXEC bug (559 bytes, application/gzip)
2020-04-24 22:50 UTC, Kevin Buettner
no flags Details
patch/fix for make FD_CLOEXEC bug (2.32 KB, patch)
2020-04-24 22:52 UTC, Kevin Buettner
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
GNU Savannah 58232 0 None None None 2020-04-24 22:50:15 UTC

Description Kevin Buettner 2020-04-24 22:50:16 UTC
Created attachment 1681655 [details]
Test case demonstrating the make FD_CLOEXEC bug

See: https://savannah.gnu.org/bugs/?58232

This is the upstream bug report for the same problem described below...

Description of problem:

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.


Version-Release number of selected component (if applicable):

make-4.3-1.fc33.x86_64

Problem is also present in upstream git repository for make.

How reproducible:


Steps to Reproduce:
1. Download the attachment make-cloexec-bug.tgz.
2. tar xf make-cloexec-bug.tgz
3. cd make-cloexec-bug
4. make -j4

Actual results:

[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 should not happen!

Expected results:

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.

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


Additional info:

I have a patch/fix for this bug.  See attachment.

This fix is important for my work on rawhide. Without it, our build / test procedure for GDB hangs.

Comment 1 Kevin Buettner 2020-04-24 22:52:14 UTC
Created attachment 1681656 [details]
patch/fix for make FD_CLOEXEC bug

Comment 2 Kevin Buettner 2020-05-03 18:39:06 UTC
My patch has been committed/pushed to the upstream git repo for "make".  Commit id is d79fe162c009788888faaf0317253b6f0cac7092 .

Comment 3 Ben Cotton 2020-08-11 15:27:32 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.

Comment 4 Ben Cotton 2021-11-04 17:36:21 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Ben Cotton 2021-11-30 16:19:06 UTC
Fedora 33 changed to end-of-life (EOL) status on 2021-11-30. Fedora 33 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.