Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jul 2020 22:05:41 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        FreeBSD ports <freebsd-ports@freebsd.org>
Subject:   security/nss build failure under poudriere, "symlink creation race",  head -r363590 FreeBSD and head -r543636 ports
Message-ID:  <545B857B-6A55-4C71-BA3D-6F9F5BF9F059@yahoo.com>
References:  <545B857B-6A55-4C71-BA3D-6F9F5BF9F059.ref@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
While building ports for a cortexA53 (aarch64) on a cortexA57
system via poudriere-devel use I got:

gmake[5]: Leaving directory =
'/wrkdirs/usr/ports/security/nss/work/nss-3.55/nss/lib/ckfw/builtins'
gmake[4]: *** [../../coreconf/rules.mk:387: =
../../../dist/public/nss/nssckmdt.h] Abort trap (core dumped)
gmake[4]: *** Deleting file '../../../dist/public/nss/nssckmdt.h'

gdb reports that:

Core was generated by =
`../../coreconf/nsinstall/FreeBSD13.0_OPT.OBJ/nsinstall -R -m 444 =
nssckmdt.h ../.'

(gdb) bt
#0  thr_kill () at thr_kill.S:4
#1  0x00000000404adc70 in __raise (s=3D6) at =
/usr/src/lib/libc/gen/raise.c:52
#2  0x0000000040428a74 in abort () at =
/usr/src/lib/libc/stdlib/abort.c:67
#3  0x0000000000212a50 in fail (format=3D<optimized out>) at =
pathsub.c:53
#4  0x0000000000212438 in main (argc=3D<optimized out>, argv=3D<optimized =
out>) at nsinstall.c:330

(gdb) up 4
#4  0x0000000000212438 in main (argc=3D<optimized out>, argv=3D<optimized =
out>) at nsinstall.c:330
330	                    fail("symlink was attempted in working =
directory %s "
(gdb) list
325			exists =3D 0;
326		    }
327		    if (!exists && symlink(name, toname) < 0) {
328			if (errno =3D=3D EEXIST) {
329			    fprintf(stderr, "symlink creation race: =
%s\n", toname);
330	                    fail("symlink was attempted in working =
directory %s "
331	                         "from %s to %s.\n", cwd, name, toname);
332			    goto retry;
333			}
334			diagnosePath(toname);

(gdb) print cwd
$1 =3D 0x40a18000 =
"/wrkdirs/usr/ports/security/nss/work/nss-3.55/nss/lib/ckfw"
(gdb) print name
$2 =3D 0x40a18800 "../../../nss/lib/ckfw/nssckmdt.h"
(gdb) print toname
$3 =3D 0x40a1b000 =
"/wrkdirs/usr/ports/security/nss/work/nss-3.55/dist/public/nss/nssckmdt.h"=


More specifically the code (with more context) is:

retry:
        exists =3D (lstat(toname, &tosb) =3D=3D 0);
. . .
            /* Check for a pre-existing symlink with identical content. =
*/
            if (exists &&
                (!S_ISLNK(tosb.st_mode) ||
                 readlink(toname, buf, sizeof buf) !=3D len ||
                 strncmp(buf, name, len) !=3D 0)) {
                int rmrv;
                rmrv =3D (S_ISDIR(tosb.st_mode) ? rmdir : =
unlink)(toname);
                if (rmrv < 0) {
                    fail("destination exists, cannot remove %s", =
toname);
                }
                exists =3D 0;
            }
            if (!exists && symlink(name, toname) < 0) {
                if (errno =3D=3D EEXIST) {
                    fprintf(stderr, "symlink creation race: %s\n", =
toname);
                    fail("symlink was attempted in working directory %s =
"
                         "from %s to %s.\n", cwd, name, toname);
                    goto retry;
                }
                diagnosePath(toname);
                fail("cannot make symbolic link %s", toname);
            }
. . .

The "goto retry" is odd given the "fail" use and:

void
fail(char *format, ...)
{
. . .
    abort();
    exit(1);
}



The poudriere bulk is still going, building other things.
So it will be some time before I find out if this repeats
for the next bulk run.

=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?545B857B-6A55-4C71-BA3D-6F9F5BF9F059>