From owner-freebsd-stable@FreeBSD.ORG Sat May 24 00:10:29 2014 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B30741D for ; Sat, 24 May 2014 00:10:29 +0000 (UTC) Received: from mail-ig0-f178.google.com (mail-ig0-f178.google.com [209.85.213.178]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5443A23F3 for ; Sat, 24 May 2014 00:10:28 +0000 (UTC) Received: by mail-ig0-f178.google.com with SMTP id hl10so1331412igb.11 for ; Fri, 23 May 2014 17:10:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=TJc1JXh2Lfhh6pcCfHptt867UzstaU47XXurpxg7uXc=; b=LRTK9oBROZ219UkevnVK0pW7TYBrYVVFvhd615EW6RXaxOlxo7gTuYvJJYE5h3+T9R L/ZCHt/YCkTZGBxvcXv6l5znU2UA7Xe9DaZI7uo148RR5QzXl/4dWt0PNKqH3fGsBN9I O0Py8wqD5UJBIhDS4Yc6EwG3hJ9uqHqR6m3t4g1LB3fZ6+Z8TGXCNhde77D0hIviJhKa fYN8gRzaXULFS9Gr9wtL+dVkak7DpWtbWLWZT0eX4/kYJDhAdV+89QUwDmXfBFRGJTru hPe7xXLzYw71C2ZxQc7ktxDT2P9Vd8PdGVOL24v3oppWg5ck7AxSpX6FDoiZUfjgxTNc pUwQ== X-Gm-Message-State: ALoCoQnGxHiZYl+pxg/cvDf8rFyPuhOVtfHhe46MMwQ+KRf5Yzg7zn/xfwCrlJP9d/DtzlEVZw0n X-Received: by 10.43.138.8 with SMTP id iq8mr7968960icc.37.1400890228296; Fri, 23 May 2014 17:10:28 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id m1sm7744875ige.22.2014.05.23.17.10.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 17:10:27 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: build order race after SUBDIR_PARALLEL (264303) In-Reply-To: <1400848012.1152.311.camel@revolution.hippie.lan> Date: Fri, 23 May 2014 18:10:34 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <99C992EE-5289-4FCC-AD30-AFE326AB8C4F@gmail.com> References: <20140523065653.GA86035@onelab2.iet.unipi.it> <1400848012.1152.311.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1878.2) Cc: dim@FreeBSD.org, stable@FreeBSD.org, Luigi Rizzo 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: Sat, 24 May 2014 00:10:29 -0000 On May 23, 2014, at 6:26 AM, Ian Lepore wrote: > 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. >>=20 >> 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: >>=20 >> --- 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=3Dgnu99 -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/s= ig/sig_party.c -o sig_ >> party.o >> --- all_subdir_libproc --- >> = /usr/home/luigi/FreeBSD/R10/../usr/obj-pico-amd64/usr/home/luigi/FreeBSD/R= 10/tmp/usr/bin/ld: cannot find -lsupc++ >> *** [libproc.so.2] Error code 1 >>=20 >> make[5]: stopped in /usr/home/luigi/FreeBSD/R10/lib/libproc >> 1 error >> ... >>=20 >>=20 >> 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. >>=20 >> This is a race condition so you may or may not see the problem >> depending on what you are building and where. >>=20 >> 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 >>=20 >> Building the above with -j 4 seem to work fine, >> as it works building HEAD with -j 8 >>=20 >> cheers >> luigi >=20 > 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. I committed a half-assed fix to current that could be MFC=92d to fix = this. Warner=