From owner-freebsd-stable@FreeBSD.ORG Fri May 23 12:26:58 2014 Return-Path: Delivered-To: stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFBA5A03; Fri, 23 May 2014 12:26:58 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 851C026C3; Fri, 23 May 2014 12:26:57 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WnoYq-000D49-AN; Fri, 23 May 2014 12:26:56 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s4NCQqEi047618; Fri, 23 May 2014 06:26:53 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19DhcijJ98WjLYRF6bqWAwI Subject: Re: build order race after SUBDIR_PARALLEL (264303) From: Ian Lepore To: Luigi Rizzo In-Reply-To: <20140523065653.GA86035@onelab2.iet.unipi.it> References: <20140523065653.GA86035@onelab2.iet.unipi.it> Content-Type: text/plain; charset="us-ascii" Date: Fri, 23 May 2014 06:26:52 -0600 Message-ID: <1400848012.1152.311.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: stable@FreeBSD.org, dim@FreeBSD.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 12:26:58 -0000 On Fri, 2014-05-23 at 08:56 +0200, Luigi Rizzo wrote: > Hi, > I have recently hit a problem when building stable/10 with > "make -j 8" which i tracked down to svn 264303, the > MFC of the SUBDIR_PARALLEL build feature. > > With a large number of parallel tasks (and GCC; > it is a race condition so timing matters), the build fails > during the toolchain target with this: > > --- sig_party.o --- > cc -O2 -pipe -I/usr/home/luigi/FreeBSD/R10/lib/libngatm/../../sys/contrib/ngatm -I/usr/home/luigi/FreeBSD/R10/../usr/obj-pico-amd64/usr/home/luigi/FreeBSD/R10/lib/libngatm > -I/usr/home/luigi/FreeBSD/R10/lib/libngatm/../../contrib/ngatm/libngatm -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter - > Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline > -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /usr/home/luigi/FreeBSD/R10/lib/libngatm/../../sys/contrib/ngatm/netnatm/sig/sig_party.c -o sig_ > party.o > --- all_subdir_libproc --- > /usr/home/luigi/FreeBSD/R10/../usr/obj-pico-amd64/usr/home/luigi/FreeBSD/R10/tmp/usr/bin/ld: cannot find -lsupc++ > *** [libproc.so.2] Error code 1 > > make[5]: stopped in /usr/home/luigi/FreeBSD/R10/lib/libproc > 1 error > ... > > > Turns out that before SUBDIR_PARALLEL, libsupc++ was built > before libproc thus satisfying the dependency; but with > -j XXX we cannot guarantee the ordering and there is no > explicit constraint or .ORDER in the makefiles to build > things in the correct order. > > This is a race condition so you may or may not see the problem > depending on what you are building and where. > > I am seeing the problem consistently on stable/10 after 264303 > when building toolchain with GCC (not clang) on an 8-core machine > and make -j 8 > > Building the above with -j 4 seem to work fine, > as it works building HEAD with -j 8 > > cheers > luigi Aha. I asked for exactly this info on the commit list (so you can ignore that request). Warner & I kicked around some ideas on how to solve this a while back, I'll see if I can make some progress towards better dependency controls for SUBDIR_PARALLEL this weekend. -- Ian