From owner-freebsd-current@FreeBSD.ORG Thu Feb 13 17:42:26 2014 Return-Path: Delivered-To: freebsd-current@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 9BEEE435; Thu, 13 Feb 2014 17:42:26 +0000 (UTC) Received: from ppsw-52.csi.cam.ac.uk (ppsw-52.csi.cam.ac.uk [IPv6:2001:630:212:8::e:f52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5AF681D12; Thu, 13 Feb 2014 17:42:26 +0000 (UTC) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from cpc28-cmbg15-2-0-cust64.5-4.cable.virginm.net ([86.27.189.65]:55850 helo=[192.168.0.7]) by ppsw-52.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.158]:465) with esmtpsa (PLAIN:dc552) (TLSv1:AES128-SHA:128) id 1WE0Iq-0007vV-EV (Exim 4.82_3-c0e5623) (return-path ); Thu, 13 Feb 2014 17:42:24 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: LLVM bug WRT temporary files? From: David Chisnall In-Reply-To: <21FB3229-E39C-424C-B18A-DD5932A32885@xcllnt.net> Date: Thu, 13 Feb 2014 17:42:25 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <9DFFC955-D1BB-47CB-9AF9-03A5DC93958A@cl.cam.ac.uk> References: <21FB3229-E39C-424C-B18A-DD5932A32885@xcllnt.net> To: Marcel Moolenaar X-Mailer: Apple Mail (2.1827) Sender: "Dr D. Chisnall" X-Mailman-Approved-At: Thu, 13 Feb 2014 19:47:04 +0000 Cc: freebsd-toolchain@FreeBSD.org, "FreeBSD-CURRENT@freebsd.org Current" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Feb 2014 17:42:26 -0000 This looks like a bug, please file an llvm PR. The offending code seems = to be createUniqueEntity() in lib/Support/Unix/Path.inc, which does... = something. Something weird and convoluted that seems to try to = implement mkstemp() / mkdtemp() in an incomprehensible way. David On 13 Feb 2014, at 17:33, Marcel Moolenaar wrote: > Guys, >=20 > I'm running into a build break that relates to the temporary files > that LLVM creates: >=20 > svl-junos-j019% cc --version > FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 > Target: arm--freebsd10.0-gnueabi > Thread model: posix >=20 >=20 > On a build machine /tmp/b is a directory and created by user X. > I am doing a buildworld on that machine as user Y (Y=3Dmarcelm) and > I don't have permissions in /tmp/b. The build gets to usr.bin/awk > and it has a source file called b.c >=20 >=20 > The build fails with: >=20 > --- b.o --- > cc -O -pipe -DHAS_ISBLANK -I. = -I/b/marcelm/buildbot/FreeBSD_arm_arm/build/usr.bin/awk/../../contrib/one-= true-awk -DFOPEN_MAX=3D64 -std=3Dgnu99 -Qunused-arguments = -Wsystem-headers -Werror -Wno-pointer-sign -Wno-empty-body = -Wno-string-plus-int -Wno-tautological-compare -Wno-unused-value = -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion = -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter = -Wno-parentheses -c = /b/marcelm/buildbot/FreeBSD_arm_arm/build/usr.bin/awk/../../contrib/one-tr= ue-awk/b.c > cc: error: unable to make temporary file: /tmp/b: can't make unique = filename: Permission denied > *** [b.o] Error code 1 >=20 >=20 > Running truss shows: >=20 > = access("/b/marcelm/buildbot/FreeBSD_arm_arm/build/usr.bin/awk/../../contri= b/one-true-awk/b.c",0) =3D 0 (0x0) > stat("/tmp/b",{ mode=3Ddrwxr-xr-x ,inode=3D235520,size=3D512,blksize=3D1= 6384 }) =3D 0 (0x0) > open("/dev/random",O_RDONLY,00) =3D 3 (0x3) > read(3,"\M^S\M^H\^S65S'*\M-T\M-r\^A9\M-K"...,128) =3D 128 (0x80) > close(3) =3D 0 (0x0) > stat("/tmp/b",{ mode=3Ddrwxr-xr-x ,inode=3D235520,size=3D512,blksize=3D1= 6384 }) =3D 0 (0x0) > open("/tmp/b/B8owDb",O_RDWR|O_CREAT|O_EXCL,0600) ERR#13 'Permission = denied' >=20 >=20 > Now, if I compile another file, I get: >=20 > = access("/b/marcelm/buildbot/FreeBSD_arm_arm/build/usr.bin/awk/../../contri= b/one-true-awk/lex.c",0) =3D 0 (0x0) > stat("/tmp/lex",0x7fffffffbab0) ERR#2 'No such = file or directory' > open("/dev/random",O_RDONLY,00) =3D 3 (0x3) > read(3,"\^F\r\M-J\M-5Z\M-fK\^E\M-2'\M-1"...,128) =3D 128 (0x80) > close(3) =3D 0 (0x0) > stat("/tmp",{ mode=3Ddrwxrwxrwt ,inode=3D2,size=3D9728,blksize=3D16384 = }) =3D 0 (0x0) > open("/tmp/lex-pDQnPA",O_RDWR|O_CREAT|O_EXCL,0600) =3D 3 (0x3) > close(3) =3D 0 (0x0) >=20 >=20 > So for some reason when /tmp/ exists and is a directory, = then the > compiler wants to create a temporary file underneath that directory. = That > looks like a bug to me. Do people concur and thus shall I file a PR? >=20 > --=20 > Marcel Moolenaar > marcel@xcllnt.net >=20 >=20