From owner-freebsd-hackers@freebsd.org Thu Aug 24 18:15:48 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A980ADE54A9 for ; Thu, 24 Aug 2017 18:15:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 696301944; Thu, 24 Aug 2017 18:15:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::3582:7cb6:200b:aa6d] (unknown [IPv6:2001:470:7a58:0:3582:7cb6:200b:aa6d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6749730CA3; Thu, 24 Aug 2017 20:15:40 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_CA0A6D5A-0480-4BCC-8553-52B4A5ED8945"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Runaway process in -CURRENT Date: Thu, 24 Aug 2017 20:15:34 +0200 In-Reply-To: Cc: FreeBSD Hackers , Ed Maste , Benjamin Kramer , Hans Wennborg To: =?utf-8?Q?Fernando_Apestegu=C3=ADa?= References: <71697463-4E52-4B46-B60B-00BDD87D8A2C@FreeBSD.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Aug 2017 18:15:48 -0000 --Apple-Mail=_CA0A6D5A-0480-4BCC-8553-52B4A5ED8945 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 24 Aug 2017, at 16:42, Fernando Apestegu=C3=ADa = wrote: >=20 > On Thu, Aug 24, 2017 at 11:14 AM, Fernando Apestegu=C3=ADa > wrote: ... > Just for the record, I got another email. Log URL: >=20 > = http://beefy11.nyi.freebsd.org/data/head-i386-default/p448640_s322824/logs= /stepcode-0.8_1.log ... > schemas/sdai_wip210e3/CMakeFiles/sdai_wip210e3.dir/SdaiAll.cc.o -MF > schemas/sdai_wip210e3/CMakeFiles/sdai_wip210e3.dir/SdaiAll.cc.o.d -o > schemas/sdai_wip210e3/CMakeFiles/sdai_wip210e3.dir/SdaiAll.cc.o -c > schemas/sdai_wip210e3/SdaiAll.cc > =3D=3D=3D=3D>> Killing runaway build after 7200 seconds with no output Hm, I had not noticed two facts, one being that there are a great many copies of SdaiAll.cc files, which all seem to be generated, and the other that this is occurring on i386. There are also other generated files, and specifically the compstructs.cc files can take extremely long to compile. On amd64, the longest compile time in the whole port is ~185 seconds, for a generated file of ~28000 lines: time lines filename =3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 184.90 28345 schemas/sdai_wip210e3/compstructs.cc 115.08 103 = schemas/sdai_ap239/SdaiAP239_PRODUCT_LIFE_CYCLE_SUPPORT_ARM_LF_unity_types= .cc 110.00 440 = schemas/sdai_cd209/SdaiAP209_MULTIDISCIPLINARY_ANALYSIS_AND_DESIGN_MIM_LF_= unity_types.cc 106.70 292 = schemas/sdai_wip210e3/SdaiAP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKA= GING_DESIGN_MIM_LF_unity_types.cc 90.73 290 = schemas/sdai_cd242/SdaiAP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF_uni= ty_types.cc 88.77 2232 = schemas/sdai_cd209/SdaiAP209_MULTIDISCIPLINARY_ANALYSIS_AND_DESIGN_MIM_LF_= unity_entities.cc 81.87 2174 = schemas/sdai_wip210e3/SdaiAP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKA= GING_DESIGN_MIM_LF_unity_entities.cc 73.92 19658 schemas/sdai_cd209/compstructs.cc 64.82 1734 = schemas/sdai_cd242/SdaiAP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF_uni= ty_entities.cc 61.42 189 = schemas/sdai_ap210e2/SdaiAP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAG= ING_DESIGN_MIM_LF_unity_types.cc On i386, this time is enormously increased, especially for the files with lots of lines: time lines filename =3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 4809.23 28345 schemas/sdai_wip210e3/compstructs.cc 2164.37 19658 schemas/sdai_cd209/compstructs.cc 2056.54 15806 schemas/sdai_ap210e2/compstructs.cc 1545.19 16679 schemas/sdai_cd242/compstructs.cc 446.49 7667 schemas/sdai_ap203e2/compstructs.cc 273.96 6297 schemas/sdai_ap214e3/compstructs.cc 187.16 103 = schemas/sdai_ap239/SdaiAP239_PRODUCT_LIFE_CYCLE_SUPPORT_ARM_LF_unity_types= .cc 163.39 440 = schemas/sdai_cd209/SdaiAP209_MULTIDISCIPLINARY_ANALYSIS_AND_DESIGN_MIM_LF_= unity_types.cc 130.02 2232 = schemas/sdai_cd209/SdaiAP209_MULTIDISCIPLINARY_ANALYSIS_AND_DESIGN_MIM_LF_= unity_entities.cc 122.15 290 = schemas/sdai_cd242/SdaiAP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF_uni= ty_types.cc The compstructs.cc and SdaiAll.cc files contain *extremely* large generated functions, in most cases embodying the whole file, even. It seems that this is the cause for the long compile times. A test case tarball with the preprocessed version of the top compstructs.cc file, and a shell script to run it, is here: http://www.andric.com/freebsd/clang/stepcode.tar.xz With clang 4.0.0, the compile times are more at the level of the amd64 builds, even on i386. So this regressed somewhere along the way to 5.0.0. I will have to try to find out where, to see if there is an existing bug report or workaround. Note that in r321664, about three weeks ago, I already committed a couple of upstream fixes for some situations where compile times could get excessive (see also https://bugs.llvm.org/show_bug.cgi?id=3D33900), but it doesn't seem to have helped in this case. As a quick workaround, the port can be modified to compile these files using a lower optimization level. If -O1 is used for the longest case, e.g. schemas/sdai_wip210e3/compstructs.cc, the compile time drops down to ~30s. I don't think it will matter very much for the speed or size of the output. -Dimitry --Apple-Mail=_CA0A6D5A-0480-4BCC-8553-52B4A5ED8945 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.1 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWZ8XxgAKCRCwXqMKLiCW o5poAJ0cJ1pF6j7vSKpYl9y3dsyrKg6qEgCgtwYrJQRKKuZlsahlStSK121oOFs= =wlbL -----END PGP SIGNATURE----- --Apple-Mail=_CA0A6D5A-0480-4BCC-8553-52B4A5ED8945--