Bug 152661 - parallel make sometimes gets working dir confused
Summary: parallel make sometimes gets working dir confused
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 8.1-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-29 03:50 UTC by Garrett Wollman
Modified: 2018-01-03 05:13 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Garrett Wollman 2010-11-29 03:50:09 UTC
A parallel build of the current OpenAFS source fails in a strange way:
one command is not executed in the correct working directory.  The
top-level OpenAFS Makefile was slightly altered to show the working
directory prior to executing the command which fails, and confirms
this (seen in the output of "make -P -j2 -dj"):

Process 54997 exited or stopped.
Job queue is no longer full.
Results of making cmdebug:
gcc  -L/usr/home/buildbot/openafs-master/openafs/lib  -O    -g -O2  -O  -I/usr/home/buildbot/openafs-master/openafs/src/config -I/usr/home/buildbot/openafs-master/openafs/include  -I. -I.     -O2 -pipe -fPIC   -o cmdebug cmdebug.o /usr/home/buildbot/openafs-master/openafs/lib/libsys.a  /usr/home/buildbot/openafs-master/openafs/lib/libafsint.a  /usr/home/buildbot/openafs-master/openafs/lib/librxkad.a  /usr/home/buildbot/openafs-master/openafs/lib/libauth.a  /usr/home/buildbot/openafs-master/openafs/lib/libcom_err.a  /usr/home/buildbot/openafs-master/openafs/lib/libcmd.a  /usr/home/buildbot/openafs-master/openafs/lib/librx.a  /usr/home/buildbot/openafs-master/openafs/lib/libsys.a  /usr/home/buildbot/openafs-master/openafs/lib/liblwp.a  /usr/home/buildbot/openafs-master/openafs/lib/libafsutil.a -lrokenafs 
Process 54997 exited.
*** Completed successfully
echo -n 'cwd is '; pwd && cd src && cd venus/test && make all
cwd is /usr/home/buildbot/openafs-master/openafs/src/venus
cd: can't cd to src
Process 54940 exited.
*** Error code 2
1 error
Process 48701 exited.
*** Error code 2
1 error
Process 48699 exited.
*** Error code 2
1 error

The command line starting with "echo" above is from the top-level
Makefile, /usr/home/buildbot/openafs-master/openafs/Makefile, and
should be executed there, but instead it's executed in the same
directory as the previous command.  (The original Makefile does not
include the echo or the pwd command; the line in question is the only
one that mentions "venus/test".)

Fix: 

Only workaround is to use GNU make or to eschew parallel make.
How-To-Repeat: 
Check out the current OpenAFS sources from
git://git.openafs.org/openafs.git (revision
3f69d7247cfbd809aeed1e4d943c2b21da035654 if I'm reading the entrails
correctly).  Run regen.sh and configure according to the
documentation.

Run "make -j2".  Watch it fail.  Run plain "make" and watch it
succeed.  Run "gmake -j2" and watch it succeed.
Comment 1 Garrett Wollman 2010-11-29 05:37:05 UTC
Using the "-B" flag (to suppress shell sharing) also works around this
bug.

-GAWollman
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:25 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped