Bug 253614

Summary: security/nss: apparently needs MAKE_JOBS_UNSAFE
Product: Ports & Packages Reporter: Andrew "RhodiumToad" Gierth <andrew>
Component: Individual Port(s)Assignee: freebsd-gecko (Nobody) <gecko>
Status: Open ---    
Severity: Affects Some People CC: marietto2008, vishwin
Priority: --- Keywords: needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (gecko)
Hardware: Any   
OS: Any   

Description Andrew "RhodiumToad" Gierth 2021-02-18 08:52:34 UTC
Had this error twice out of two attempts when trying to build security/nss on stable/13:

../../coreconf/nsinstall/FreeBSD13.0_OPT.OBJ/nsinstall -R -m 444 nssckt.h ../../../dist/public/nss
symlink creation race: /wrkdirs/usr/ports/security/nss/work/nss-3.61/dist/public/nss/nssckfwc.h
nsinstall: symlink was attempted in working directory /wrkdirs/usr/ports/security/nss/work/nss-3.61/nss/lib/ckfw from ../../../nss/lib/ckfw/nssckfwc.h to /wrkdirs/usr/ports/security/nss/work/nss-3.61/dist/public/nss/nssckfwc.h.
: File exists
../../coreconf/nsinstall/FreeBSD13.0_OPT.OBJ/nsinstall -R -m 444 nssckt.h ../../../dist/public/nss
gmake[5]: *** [../../coreconf/rules.mk:387: ../../../dist/public/nss/nssckfwc.h] Abort trap (core dumped)
gmake[5]: *** Deleting file '../../../dist/public/nss/nssckfwc.h'

Manually setting MAKE_JOBS_UNSAFE allowed the build to succeed.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2021-02-18 09:09:48 UTC
What architecture and how many make jobs were used? Did you try old nss versions? Maybe there's a regression. ports r537010 removed MAKE_JOBS_UNSAFE due to https://bugzilla.mozilla.org/show_bug.cgi?id=290526
Comment 2 Andrew "RhodiumToad" Gierth 2021-02-18 09:15:51 UTC
(In reply to Jan Beich from comment #1)

amd64, host 4-core intel skylake cpu, bhyve VM with 4 vCPUs, using poudriere with ALLOW_MAKE_JOBS=yes, therefore 4 jobs used.

Did not try other nss versions.
Comment 3 Charlie Li freebsd_committer freebsd_triage 2021-02-19 20:38:01 UTC
This doesn't seem related to that upstream bug.

I occasionally hit nsinstall crashing during build with ALLOW_MAKE_JOBS, but trying the build again succeeds, so ime this only happens intermittently. Also on amd64, but with three jobs; have not tried with two jobs. Been happening for the past couple versions iirc (not sure if my old build logs still exist).
Comment 4 Andrew "RhodiumToad" Gierth 2021-02-20 11:49:47 UTC
Note, this is NOT fixed in nss 3.62: I've had 2 build failures out of 5 attempts so far when jobs are enabled.
Comment 5 mario felicioni 2024-03-16 12:33:30 UTC
I found a similar problem in FreeBSD 13.3. Today I tried the installation of Firefox 124 (using the default options offered by the port) from ports but the compilation stopped when it tried to compile the port "security / nss". So,I tried to compile it as a standalone port and I saw the same behavior. Maybe it stopped because a bug,but I'm not sure. nss is part of Firefox,so I don't know how to exclude it. If it crashes,even Firefox crashes :

mario@marietto-133:/usr/ports/security/nss # doas make MAKE_JOBS_UNSAFE=yes

......

/usr/ports/security/nss/work/nss-
3.98/nss/cmd/shlibsign/FreeBSD13.3_OPT.OBJ/shlibsign -v -i 

/usr/ports/security/nss/work/nss-
3.98/nss/cmd/shlibsign/../../../dist/FreeBSD13.3_OPT.OBJ/lib/libsoftokn3.so

moduleSpec configdir='' certPrefix='' keyPrefix='' secmod='' flags=noCertDB, noModDB

C_Initialize failed: 0x00000030, CKR_DEVICE_ERROR              
NSPR error code: -5977: Failure to load dynamic library
Initiailzing softoken failed: 0x00000030, CKR_DEVICE_ERROR              
NSPR error code: -5977: Failure to load dynamic library

gmake[4]: *** [Makefile:92: ../../../dist/FreeBSD13.3_OPT.OBJ/lib/libsoftokn3.chk] 
Error 1
gmake[4]: Leaving directory '/usr/ports/security/nss/work/nss-
3.98/nss/cmd/shlibsign'
gmake[3]: *** [Makefile:100: libs] Error 2
gmake[3]: Leaving directory '/usr/ports/security/nss/work/nss-
3.98/nss/cmd/shlibsign'
gmake[2]: *** [../coreconf/rules.mk:44: shlibsign] Error 2
gmake[2]: Leaving directory '/usr/ports/security/nss/work/nss-3.98/nss/cmd'
gmake[1]: *** [coreconf/rules.mk:44: cmd] Error 2
gmake[1]: Leaving directory '/usr/ports/security/nss/work/nss-3.98/nss'
gmake: *** [manifest.mn:21: all] Error 2
*** Error code 1

I've upgraded the ports tree several times with portsnap :

# portsnap fetch extract
# portsnap fetch update
Comment 6 mario felicioni 2024-03-16 12:35:20 UTC
I have also tried like this :

root@marietto-133:/usr/ports/www/firefox # make ALLOW_MAKE_JOBS=yes MAKE_JOBS_UNSAFE=yes

/usr/ports/security/nss/work/nss-3.98/nss/cmd/shlibsign/FreeBSD13.3_OPT.OBJ/shlibsign -v -i /usr/por
ts/security/nss/work/nss-3.98/nss/cmd/shlibsign/../../../dist/FreeBSD13.3_OPT.OBJ/lib/libsoftokn3.so
moduleSpec configdir='' certPrefix='' keyPrefix='' secmod='' flags=noCertDB, noModDB
C_Initialize failed: 0x00000030, CKR_DEVICE_ERROR                     
NSPR error code: -5977: Failure to load dynamic library
Initiailzing softoken failed: 0x00000030, CKR_DEVICE_ERROR                     
NSPR error code: -5977: Failure to load dynamic library
gmake[4]: *** [Makefile:92: ../../../dist/FreeBSD13.3_OPT.OBJ/lib/libsoftokn3.chk] Error 1
gmake[4]: Leaving directory '/usr/ports/security/nss/work/nss-3.98/nss/cmd/shlibsign'
gmake[3]: *** [Makefile:100: libs] Error 2
gmake[3]: Leaving directory '/usr/ports/security/nss/work/nss-3.98/nss/cmd/shlibsign'
gmake[2]: *** [../coreconf/rules.mk:44: shlibsign] Error 2
gmake[2]: Leaving directory '/usr/ports/security/nss/work/nss-3.98/nss/cmd'
gmake[1]: *** [coreconf/rules.mk:44: cmd] Error 2
gmake[1]: Leaving directory '/usr/ports/security/nss/work/nss-3.98/nss'
gmake: *** [manifest.mn:21: all] Error 2
*** Error code 1 

This is the system that I'm using :

# freebsd-version -kru ; uname -aKU

13.3-RELEASE
13.3-RELEASE
13.3-RELEASE

FreeBSD marietto-133 13.3-RELEASE FreeBSD 13.3-RELEASE releng/13.3-n257428-80d2b634ddf0 GENERIC amd64 1303001 1303001