Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Feb 2014 17:42:25 +0000
From:      David Chisnall <David.Chisnall@cl.cam.ac.uk>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        freebsd-toolchain@FreeBSD.org, "FreeBSD-CURRENT@freebsd.org Current" <freebsd-current@freebsd.org>
Subject:   Re: LLVM bug WRT temporary files?
Message-ID:  <9DFFC955-D1BB-47CB-9AF9-03A5DC93958A@cl.cam.ac.uk>
In-Reply-To: <21FB3229-E39C-424C-B18A-DD5932A32885@xcllnt.net>
References:  <21FB3229-E39C-424C-B18A-DD5932A32885@xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <marcel@xcllnt.net> 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/<basename> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9DFFC955-D1BB-47CB-9AF9-03A5DC93958A>