Bug 885474

Summary: make bails with *** INTERNAL: readdir: Bad file descriptor
Product: [Fedora] Fedora Reporter: Andrew Schultz <ajschult784>
Component: makeAssignee: Patsy Griffin <pfrankli>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: philipp, pmachata, samuel-rhbugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-03 18:59:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1017084    
Bug Blocks:    

Description Andrew Schultz 2012-12-09 17:30:48 UTC
Description of problem:
with fairly simple Makefiles, make will bail with

*** INTERNAL: readdir: Bad file descriptor

Version-Release number of selected component (if applicable):
make-3.82-13.fc17.x86_64

How reproducible:
every time

Steps to Reproduce:
1. create two Makefiles,
Makefile:
-----------
default:
        make -f Makefile2
-----------

Makefile2:
-----------
vpath %.c    /home/andrew/

foo:
-----------

2. invoke make
# make -j 2

Actual results:
===========
make -f Makefile2
make[1]: Entering directory `/build/andrew/test'
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
make[1]: *** INTERNAL: readdir: Bad file descriptor
.  Stop.
make[1]: Makefile2: Field 'stem' not cached: Makefile2

make[1]: Leaving directory `/build/andrew/test'
make: *** [default] Error 2
===========

Expected results:
===========
make -f Makefile2
make[1]: Entering directory `/build/andrew/test'
make[1]: Nothing to be done for `foo'.
make[1]: Leaving directory `/build/andrew/test'
===========

Additional info:
the path on the vpath line must exist, but need not have anything interesting in it.  This problem can be avoided by omitting "-j 2".  This bug can be encountered building ffmpeg
http://forums.gentoo.org/viewtopic-t-918138-start-0.html

Comment 1 Fedora End Of Life 2013-07-04 02:42:38 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. 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 WONTFIX if it remains open with a Fedora 
'version' of '17'.

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 prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 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 to Fedora 17's end of life.

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 2 Andrew Schultz 2013-07-04 02:59:39 UTC
still an issue with Fedora 18 (make 3.82-14)

Comment 3 Philip Prindeville 2013-08-30 23:24:51 UTC
I'm seeing this also while building Openwrt from trunk.

Comment 4 Samuel Sieb 2013-09-01 16:49:39 UTC
You're trying to compile in an NFS mounted directory, right? The problem is that it can't use flock on its lock files. You can see this by using strace, that's how I discovered it. I had to move the openwrt tree to a local filesystem to be able to compile.

Comment 5 Samuel Sieb 2013-09-01 20:00:18 UTC
Sorry, should have double-checked before posting...  My issue was slightly different.

Comment 6 Petr Machata 2013-09-02 09:58:38 UTC
Got this reproduced locally on a Fedora 15 box and RHEL 7 alpha box, in both cases also with upstream make.  Doesn't seem to be Fedora-specific per se (though could of course be a patch that Red Hat carries in runtime or kernel across all these versions).  Reproduces fine on a local filesystem.

Comment 7 Petr Machata 2013-09-03 14:13:42 UTC
This depends on what the "internal" make (the one launched from Makefile) is.  Normally this would be $(MAKE) to use whatever "outer" make is used, but then it doesn't reproduce.  Make 3.81 is not impacted, 3.82 and current master are.

Comment 8 Petr Machata 2013-09-03 15:00:43 UTC
This is not right:

18706 16:46:43.945567 opendir("/home/petr" <unfinished ...>
18706 16:46:43.945713 SYS_open("/home/petr", 591872, 0172204710) = 4
18706 16:46:43.945785 SYS_brk(0)                                 = 0x1e9d000
18706 16:46:43.945824 SYS_brk(0x1ec5000)                         = 0x1ec5000
18706 16:46:43.945870 <... opendir resumed> )                    = { 4 }
[...]
18706 16:46:44.347777 close(4 <unfinished ...>
18706 16:46:44.347882 SYS_close(4)                               = 0
18706 16:46:44.347927 <... close resumed> )                      = 0
[...]
18706 16:46:45.718922 readdir({ 4 } <unfinished ...>
18706 16:46:45.719037 SYS_getdents(4, 0x161f008, 32768)          = -9
18706 16:46:45.719103 <... readdir resumed> )                    = 0

Comment 9 Petr Machata 2013-09-03 17:47:31 UTC
Upstream submission:
  https://savannah.gnu.org/bugs/index.php?39934

Comment 10 Fedora Admin XMLRPC Client 2013-09-05 01:11:25 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 11 Fedora End Of Life 2013-12-21 09:49:11 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. 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 WONTFIX if it remains open with a Fedora 
'version' of '18'.

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 prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 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 to Fedora 18's end of life.

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 12 Andrew Schultz 2013-12-21 14:01:04 UTC
This certainly affects F19's make (3.82-18).  This was fixed upstream in make 4.0.

Comment 13 Fedora End Of Life 2015-01-09 17:31:19 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

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 19 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 14 Andrew Schultz 2015-02-03 18:59:38 UTC
make 4.0 shipped for Fedora 21 and the bug is fixed there now