Re: security/nss build failure under poudriere, "symlink creation race", head -r363590 FreeBSD and head -r543636 ports

2020-07-31 Thread Mark Millard via freebsd-ports



On 2020-Jul-30, at 23:11, Tatsuki Makino  wrote:
> 
> Hmmm, I was using 2 builders by -J 2:4. But I don't remember if there
> were other jobs available when nss was building :)
> How is your poudriere set up for NO_ZFS? I'm using it with NO_ZFS=yes.

I do not have any media with ZFS in use in any of the systems that
I have access to. I instead use UFS in all of them. So I use
NO_ZFS=yes .

> And BASEFS exists within UFS.

For my context that got the problem, there is
only UFS [ignoring the efi partition contents
and the swap partitions].


Other choices in my poudriere configuration on the
cortexA57 system that are different than in
/usr/local/etc/poudriere.conf.sample :

USE_TMPFS=no
SAVE_WRKDIR=yes
WRKDIR_ARCHIVE_FORMAT=tar
ALLOW_MAKE_JOBS=yes
ALLOW_MAKE_JOBS_PACKAGES="pkg ccache py* gcc* llvm* ghc* *webkit* *office* 
chromium* iridium* mongodb*"
NOHANG_TIME=14400
BUILD_AS_NON_ROOT=no

(ALLOW_MAKE_JOBS_PACKAGES is just in case I temporarily
disable ALLOW_MAKE_JOBS for some reason.)

> I'm suspicious of gmake and UFS on this issue. But I don't know the
> details of that :)

I've no clue what to blaim for the race, other than the
retry logic that will never retry. (I do not claim to
know that such a retry would be appropriate.)


I forced poudriere to rebuild the same set of ports to
try the "large load average" context again. nss built
fine. (llvm10 and llvm11 are still building.)

Even trying to establish if MAKE_JOBS_UNSAFE use made
a difference would be problematical: failure is rare
without MAKE_JOBS_UNSAFE in my context.

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

___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: security/nss build failure under poudriere, "symlink creation race", head -r363590 FreeBSD and head -r543636 ports

2020-07-30 Thread Tatsuki Makino
Hmmm, I was using 2 builders by -J 2:4. But I don't remember if there
were other jobs available when nss was building :)
How is your poudriere set up for NO_ZFS? I'm using it with NO_ZFS=yes.
And BASEFS exists within UFS.
I'm suspicious of gmake and UFS on this issue. But I don't know the
details of that :)

Regards.

___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: security/nss build failure under poudriere, "symlink creation race", head -r363590 FreeBSD and head -r543636 ports

2020-07-30 Thread Mark Millard via freebsd-ports


On 2020-Jul-29, at 23:34, Tatsuki Makino  wrote:

> Hello.
> 
> The same thing happened to me.
> If you want the build to succeed, I think enabling DISABLE_MAKE_JOBS
> will solve the problem.

Running bulk again had no troubles, no use of MAKE_JOBS_UNSAFE
involved.

However, I use poudriere with ALLOW_MAKE_JOBS=yes and do not
restrict PARALLEL_JOBS. The first run had 4 builders running
(one per core), each allowed 4 active processes. The 2nd run
had only one builder active while building nss simply because
everything not dependent on nss had been built already.

The 4-builders, each allowed 4 active processes, apparently
makes it more likely to fail the race condition.

> Here's an excerpt from a log of my failures for the same reason.
> 
> 
> =>> Building security/nss
> build started at Tue Jun 30 01:18:43 UTC 2020
> port directory: /usr/ports/security/nss
> package name: nss-3.54
> building for: FreeBSD src-default-job-02 12.1-STABLE FreeBSD 12.1-STABLE
> 1201518 amd64
>    ︙
> Poudriere version: 3.3.4
> Host OSVERSION: 1201518
> Jail OSVERSION: 1201518
>    ︙
> ../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444 smime.h
> ../../../dist/public/nss
> ../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444
> nssckfw.h ../../../dist/public/nss
> ../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444
> nssckfw.h ../../../dist/public/nss
> ../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444
> cmsreclist.h ../../../dist/public/nss
> symlink creation race:
> /wrkdirs/usr/ports/security/nss/work/nss-3.54/dist/public/nss/nssckfw.h
> nsinstall: symlink was attempted in working directory
> /wrkdirs/usr/ports/security/nss/work/nss-3.54/nss/lib/ckfw from
> ../../../nss/lib/ckfw/nssckfw.h to /wrkdirs/usr/ports/security/nss/work>
> ../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444
> nssckfwc.h ../../../dist/public/nss
> : File exists
> ../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444
> nssckfwt.h ../../../dist/public/nss
> ../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444
> nssckfwc.h ../../../dist/public/nss
> gmake[4]: Leaving directory
> '/wrkdirs/usr/ports/security/nss/work/nss-3.54/nss/lib/smime'
>    ︙
> gmake[5]: *** [../../coreconf/rules.mk:387:
> ../../../dist/public/nss/nssckfw.h] Abort trap (core dumped)
> gmake[5]: *** Deleting file '../../../dist/public/nss/nssckfw.h'
> gmake[5]: Leaving directory
> '/wrkdirs/usr/ports/security/nss/work/nss-3.54/nss/lib/ckfw'
> gmake[4]: *** [../../coreconf/rules.mk:44: .] Error 2
> gmake[4]: Leaving directory
> '/wrkdirs/usr/ports/security/nss/work/nss-3.54/nss/lib/ckfw'
> gmake[3]: *** [../coreconf/rules.mk:44: ckfw] Error 2
> gmake[3]: Leaving directory
> '/wrkdirs/usr/ports/security/nss/work/nss-3.54/nss/lib'
> gmake[2]: *** [coreconf/rules.mk:44: lib] Error 2
> gmake[2]: Leaving directory
> '/wrkdirs/usr/ports/security/nss/work/nss-3.54/nss'
> gmake[1]: *** [manifest.mn:25: prepare_build] Error 2
> gmake[1]: Leaving directory
> '/wrkdirs/usr/ports/security/nss/work/nss-3.54/nss'
> ===> Compilation failed unexpectedly.
> Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
> the maintainer.
> *** Error code 1
> 
> Stop.
> make: stopped in /usr/ports/security/nss
> 
> 
> I don't know why it's trying to run the command twice against nssckfw.h.
> 

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

___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: security/nss build failure under poudriere, "symlink creation race", head -r363590 FreeBSD and head -r543636 ports

2020-07-29 Thread Tatsuki Makino
Hello.

The same thing happened to me.
If you want the build to succeed, I think enabling DISABLE_MAKE_JOBS
will solve the problem.

Here's an excerpt from a log of my failures for the same reason.


=>> Building security/nss
build started at Tue Jun 30 01:18:43 UTC 2020
port directory: /usr/ports/security/nss
package name: nss-3.54
building for: FreeBSD src-default-job-02 12.1-STABLE FreeBSD 12.1-STABLE
1201518 amd64
   ︙
Poudriere version: 3.3.4
Host OSVERSION: 1201518
Jail OSVERSION: 1201518
   ︙
../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444 smime.h
../../../dist/public/nss
../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444
nssckfw.h ../../../dist/public/nss
../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444
nssckfw.h ../../../dist/public/nss
../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444
cmsreclist.h ../../../dist/public/nss
symlink creation race:
/wrkdirs/usr/ports/security/nss/work/nss-3.54/dist/public/nss/nssckfw.h
nsinstall: symlink was attempted in working directory
/wrkdirs/usr/ports/security/nss/work/nss-3.54/nss/lib/ckfw from
../../../nss/lib/ckfw/nssckfw.h to /wrkdirs/usr/ports/security/nss/work>
../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444
nssckfwc.h ../../../dist/public/nss
: File exists
../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444
nssckfwt.h ../../../dist/public/nss
../../coreconf/nsinstall/FreeBSD12.1_OPT.OBJ/nsinstall -R -m 444
nssckfwc.h ../../../dist/public/nss
gmake[4]: Leaving directory
'/wrkdirs/usr/ports/security/nss/work/nss-3.54/nss/lib/smime'
   ︙
gmake[5]: *** [../../coreconf/rules.mk:387:
../../../dist/public/nss/nssckfw.h] Abort trap (core dumped)
gmake[5]: *** Deleting file '../../../dist/public/nss/nssckfw.h'
gmake[5]: Leaving directory
'/wrkdirs/usr/ports/security/nss/work/nss-3.54/nss/lib/ckfw'
gmake[4]: *** [../../coreconf/rules.mk:44: .] Error 2
gmake[4]: Leaving directory
'/wrkdirs/usr/ports/security/nss/work/nss-3.54/nss/lib/ckfw'
gmake[3]: *** [../coreconf/rules.mk:44: ckfw] Error 2
gmake[3]: Leaving directory
'/wrkdirs/usr/ports/security/nss/work/nss-3.54/nss/lib'
gmake[2]: *** [coreconf/rules.mk:44: lib] Error 2
gmake[2]: Leaving directory
'/wrkdirs/usr/ports/security/nss/work/nss-3.54/nss'
gmake[1]: *** [manifest.mn:25: prepare_build] Error 2
gmake[1]: Leaving directory
'/wrkdirs/usr/ports/security/nss/work/nss-3.54/nss'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/security/nss


I don't know why it's trying to run the command twice against nssckfw.h.

Regards.
___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


security/nss build failure under poudriere, "symlink creation race", head -r363590 FreeBSD and head -r543636 ports

2020-07-29 Thread Mark Millard via freebsd-ports
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  0x404adc70 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52
#2  0x40428a74 in abort () at /usr/src/lib/libc/stdlib/abort.c:67
#3  0x00212a50 in fail (format=) at pathsub.c:53
#4  0x00212438 in main (argc=, argv=) at 
nsinstall.c:330

(gdb) up 4
#4  0x00212438 in main (argc=, argv=) at 
nsinstall.c:330
330 fail("symlink was attempted in working directory %s 
"
(gdb) list
325 exists = 0;
326 }
327 if (!exists && symlink(name, toname) < 0) {
328 if (errno == 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 = 0x40a18000 "/wrkdirs/usr/ports/security/nss/work/nss-3.55/nss/lib/ckfw"
(gdb) print name
$2 = 0x40a18800 "../../../nss/lib/ckfw/nssckmdt.h"
(gdb) print toname
$3 = 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 = (lstat(toname, &tosb) == 0);
. . .
/* Check for a pre-existing symlink with identical content. */
if (exists &&
(!S_ISLNK(tosb.st_mode) ||
 readlink(toname, buf, sizeof buf) != len ||
 strncmp(buf, name, len) != 0)) {
int rmrv;
rmrv = (S_ISDIR(tosb.st_mode) ? rmdir : unlink)(toname);
if (rmrv < 0) {
fail("destination exists, cannot remove %s", toname);
}
exists = 0;
}
if (!exists && symlink(name, toname) < 0) {
if (errno == 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.

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

___
freebsd-ports@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"