Closed Bug 445706 Opened 18 years ago Closed 3 years ago

nsinstall reports "Symlink creation race" on AIX

Categories

(NSS :: Tools, defect, P5)

Other
AIX

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: slavomir.katuscak+mozilla, Unassigned)

References

Details

Attachments

(1 file)

Build: 20080716.1/nssaixb_AIX5.3: I was examining why signtool was not found in tests. In build log I found: ../../../coreconf/nsinstall/AIX5.3_DBG.OBJ/nsinstall -R -m 775 AIX5.3_DBG.OBJ/signtool ../../../../dist/AIX5.3_DBG.OBJ/bin symlink creation race: /share/builds/mccrel3/security/securitytip/builds/20080716.1/wozzeck_Solaris8/mozilla/dist/AIX5.3_DBG.OBJ/bin/signtool Seems that symlink was not created successfully, but actually symlink was created, but it points to incorrect path: signtool -> ../../../security/nss/cmd/signtool/../../../security/nss/cmd/signtool/AIX5.3_DBG.OBJ/signtool This seems to be a bug in nsinstall. It happened only once (this one build) and only on one AIX machine, but problem can be the same on all platforms.
Slavo, Please look into this some more. Try to answer these questions: - How did a race occur? - With what other process was nsinstall racing? - How did two processes come to be trying to create the same symlink at the same time.
Assignee: rrelyea → slavomir.katuscak
(In reply to comment #1) > Slavo, > Please look into this some more. > Try to answer these questions: > - How did a race occur? I don't see there any special circumstances. > - With what other process was nsinstall racing? Processes from previous day seems to be finished successfully. At the same day there should be no other processes which can create symlinks there. > - How did two processes come to be trying to create the same symlink at > the same time. I don't know. There is one strange thing: singtool should be linked to ../../../security/nss/cmd/signtool, but in this case it was linked to ../../../security/nss/cmd/signtool/../../../security/nss/cmd/signtool/AIX5.3_DBG.OBJ/signtool what is like ${LINK}/${LINK} instead of ${LINK} This can be caused by some bug in nsinstall or in symlink() implementation that set wrong errno. I don't think it was really race.
Summary: Symlink creation race in nsinstall. → nsinstall reports "Symlink creation race" on AIX
Slavo, Some questions : 1) Where was nsinstall running from when the failure happened ? 2) Did nsinstall actually fail with a non-zero return code ? Or did it only report the race error message ? It may have returned an error code, and the make may have ignored it. Please check that possibility too. nsinstall is supposed to retry when it encounters a race. The race corresponds to an EEXIST from symlink() . I highly doubt that multiple OSes are throwing that code in error. If it's only AIX I could believe there is an OS bug. But if you have seen this on other platforms, it is more likely to be a real race - ie there are 2 nsinstall concurrently trying to create the target link. Are there multiple AIX machines building in the same directory path perhaps ? Also, the error in the target path is very strange and likely to be a make bug.
I meant makefile bug in comment 3 of course.
AFAIK, so far, this is an AIX-only problem. In Tuesday morning's nightly trunk build on AIX, we saw another nsinstall failure. This time it did not report a race, but the error code reported was EEXIST. ../../../config/./nsinstall: cannot make symbolic link /share/builds/mccrel3/security/securitytip/builds/20080916.1/wozzeck_Solaris8/mozilla/dist/AIX5.3_OPT.OBJ/include/plbase64.h: File exists Some thoughts: - Is this the same AIX mahcine we've been using all along? - If so, has it had any recent AIX OS updates (patches) applied? - If not, is it in need of some AIX patches?
(In reply to comment #3) > Some questions : > 1) Where was nsinstall running from when the failure happened ? Standard nightly build location. > 2) Did nsinstall actually fail with a non-zero return code ? I don't have info about this, only logfile. > Or did it only report the race error message ? > It may have returned an error code, and the make may have ignored it. Please > check that possibility too. (In reply to comment #5) > AFAIK, so far, this is an AIX-only problem. Most probably. > Some thoughts: > - Is this the same AIX mahcine we've been using all along? Machine used for nightly testing. > - If so, has it had any recent AIX OS updates (patches) applied? > - If not, is it in need of some AIX patches? Christophe would know this, I'm adding him to CC.
Happened again in this morning's nightly build on AIX. nsinstall reported this error, but the build did not stop there. It should have stopped there, but since it did not, the build continued until that .a file was needed to link blapitest. Then it failed because the file was not found. The log file for the install failure contains these lines: > rm -f AIX5.3_OPT.OBJ/libpk11wrap.a > ar cr AIX5.3_OPT.OBJ/libpk11wrap.a AIX5.3_OPT.OBJ/dev3hack.o AIX5.3_OPT.OBJ/pk11akey.o AIX5.3_OPT.OBJ/pk11auth.o AIX5.3_OPT.OBJ/pk11cert.o AIX5.3_OPT.OBJ/pk11cxt.o AIX5.3_OPT.OBJ/pk11err.o AIX5.3_OPT.OBJ/pk11kea.o AIX5.3_OPT.OBJ/pk11list.o AIX5.3_OPT.OBJ/pk11load.o AIX5.3_OPT.OBJ/pk11mech.o AIX5.3_OPT.OBJ/pk11merge.o AIX5.3_OPT.OBJ/pk11nobj.o AIX5.3_OPT.OBJ/pk11obj.o AIX5.3_OPT.OBJ/pk11pars.o AIX5.3_OPT.OBJ/pk11pbe.o AIX5.3_OPT.OBJ/pk11pk12.o AIX5.3_OPT.OBJ/pk11pqg.o AIX5.3_OPT.OBJ/pk11sdr.o AIX5.3_OPT.OBJ/pk11skey.o AIX5.3_OPT.OBJ/pk11slot.o AIX5.3_OPT.OBJ/pk11util.o > ranlib AIX5.3_OPT.OBJ/libpk11wrap.a > ../../../coreconf/nsinstall/AIX5.3_OPT.OBJ/nsinstall -R -m 664 AIX5.3_OPT.OBJ/libpk11wrap.a ../../../../dist/AIX5.3_OPT.OBJ/lib > symlink creation race: /share/builds/mccrel3/security/securitytip/builds/20080923.1/wozzeck_Solaris8/mozilla/dist/AIX5.3_OPT.OBJ/lib/libpk11wrap.a > gmake[3]: Leaving directory `/share/builds/mccrel3/security/securitytip/builds/20080923.1/wozzeck_Solaris8/mozilla/security/nss/lib/pk11wrap'
So, there's a secondary bug here that also must be fixed. Perhaps there should be a separate bug filed about it. That bug is: an nsinstall failure does not halt the build.
I examined the build tree of the latest failure yesterday. This is another case where the symlink was created but pointing in the wrong place. [jp96085@monstre]/share/builds/mccrel3/security/securitytip/builds/20080923.1/nssaixb_AIX5.3/mozilla/dist/AIX5.3_OPT.OBJ/lib 99 % ls -al libpk11* !cat lrwxrwxrwx 1 svbld staff 98 Sep 23 02:16 libpk11wrap.a -> ../../../security/nss/lib/pk11wrap/../../../security/nss/lib/pk11wrap/AIX5.3_OPT.OBJ/libpk11wrap.a [jp96085@monstre]/share/builds/mccrel3/security/securitytip/builds/20080923.1/nssaixb_AIX5.3/mozilla/dist/AIX5.3_OPT.OBJ/lib 100 % !cat cat libpk11wrap.a cat: cannot open libpk11wrap.a [jp96085@monstre]/share/builds/mccrel3/security/securitytip/builds/20080923.1/nssaixb_AIX5.3/mozilla/dist/AIX5.3_OPT.OBJ/lib 101 % I think it is worth adding a little bit of logging to nsinstall just for AIX in the failure case so we can prove we are passing the correct arguments from the correct location, and that this is indeed an AIX OS bug.
Actually this doesn't really need to be conditionally compiled for AIX since it is in a failure case.
Attachment #340232 - Flags: review?(nelson)
Comment on attachment 340232 [details] [diff] [review] Add detail about symlink arguments when race occurs (checked in) r=nelson
Attachment #340232 - Flags: review?(nelson) → review+
Julien, while you're looking at nsinstall, please also solve the problem where this failure due to race doesn't stop the build. I think the program returns zero even though it failed. There is a bug about this.
Thanks, Nelson. Checking in nsinstall.c; /cvsroot/mozilla/security/coreconf/nsinstall/nsinstall.c,v <-- nsinstall.c new revision: 1.11; previous revision: 1.10 done Do you know the bug number for that other issue ? I couldn't find it.
Nelson, I examined the code in nsinstall. All fatal errors use the fail function which calls exit(1). This race is not considered fatal, however. There is a "goto retry". It probably succeeds the second time around and that's why the build doesn't stop. Maybe there is a bug and it links incorrectly to another path in the 2nd retry.
> Do you know the bug number for that other issue ? It is actually comment 7 in this very bug.
OK. Do you think I should resolve that issue by not attempting to retry the link, and just failing the first time around instead ? This would isolate a bug in the retry code making a wrong link. But I looked at that code and didn't see anything obviously bad that could happen. The name and toname variables are not changed during retry in particular. Maybe it's going to one of the other code paths the 2nd time. In principle however we should never run into this race unless there was an error from the buildmaster - trying to run 2 builds in the same place at the same time. So, always aborting the build on this failure may be a logical thing to do.
Yes. I'd rather abort the build sooner. I continue to think this is an AIX OS bug, BTW.
OK. I just changed that logging fprintf to a call to "fail" . Checking in nsinstall.c; /cvsroot/mozilla/security/coreconf/nsinstall/nsinstall.c,v <-- nsinstall.c new revision: 1.12; previous revision: 1.11 done I agree it's probably an AIX OS bug too. We will see the log info the next time it occurs.
Attachment #340232 - Attachment description: Add detail about symlink arguments when race occurs → Add detail about symlink arguments when race occurs (checked in)
Very similar failure: Build: 20081209.1/nssaixb_AIX5.3 Log: ../../config/./nsinstall -R -m 444 ../../../pr/include/nspr.h ../../../pr/include/pratom.h ../../../pr/include/prbit.h ../../../pr/include/prclist.h ../../../pr/include/prcmon.h ../../../pr/include/prcountr.h ../../../pr/include/prcvar.h ../../../pr/include/prdtoa.h ../../../pr/include/prenv.h ../../../pr/include/prerr.h ../../../pr/include/prerror.h ../../../pr/include/prinet.h ../../../pr/include/prinit.h ../../../pr/include/prinrval.h ../../../pr/include/prio.h ../../../pr/include/pripcsem.h ../../../pr/include/prlink.h ../../../pr/include/prlock.h ../../../pr/include/prlog.h ../../../pr/include/prlong.h ../../../pr/include/prmem.h ../../../pr/include/prmon.h ../../../pr/include/prmwait.h ../../../pr/include/prnetdb.h ../../../pr/include/prolock.h ../../../pr/include/prpdce.h ../../../pr/include/prprf.h ../../../pr/include/prproces.h ../../../pr/include/prrng.h ../../../pr/include/prrwlock.h ../../../pr/include/prshm.h ../../../pr/include/prshma.h ../../../pr/include/prsystem.h ../../../pr/include/prthread.h ../../../pr/include/prtime.h ../../../pr/include/prtpool.h ../../../pr/include/prtrace.h ../../../pr/include/prtypes.h ../../../pr/include/prvrsion.h ../../../pr/include/prwin16.h /share/builds/mccrel3/security/securitytip/builds/20081209.1/wozzeck_Solaris8/mozilla/security/nss/../../dist/AIX5.3_OPT.OBJ/include ../../config/./nsinstall: cannot make symbolic link /share/builds/mccrel3/security/securitytip/builds/20081209.1/wozzeck_Solaris8/mozilla/dist/AIX5.3_OPT.OBJ/include/prinrval.h: File exists gmake[4]: *** [export] Error 1 gmake[4]: Leaving directory `/share/builds/mccrel3/security/securitytip/builds/20081209.1/wozzeck_Solaris8/mozilla/nsprpub/AIX5.3_OPT.OBJ/pr/include' gmake[3]: *** [export] Error 2 gmake[3]: Leaving directory `/share/builds/mccrel3/security/securitytip/builds/20081209.1/wozzeck_Solaris8/mozilla/nsprpub/AIX5.3_OPT.OBJ/pr' gmake[2]: *** [export] Error 2 gmake[2]: Leaving directory `/share/builds/mccrel3/security/securitytip/builds/20081209.1/wozzeck_Solaris8/mozilla/nsprpub/AIX5.3_OPT.OBJ' gmake[1]: *** [build_nspr] Error 2 gmake[1]: Leaving directory `/share/builds/mccrel3/security/securitytip/builds/20081209.1/wozzeck_Solaris8/mozilla/security/nss' gmake: *** [nspr] Error 2 Link: /share/builds/mccrel3/security/securitytip/builds/20081209.1/wozzeck_Solaris8/mozilla/dist/AIX5.3_OPT.OBJ/include/prinrval.h -> ../../../nsprpub/AIX5.3_OPT.OBJ/pr/include/../../../pr/include/prinrval.h
One more failure: Build: 20081212.1/nssaixb_AIX5.3 Log: ../../../coreconf/nsinstall/AIX5.3_OPT.OBJ/nsinstall -R -m 664 AIX5.3_OPT.OBJ/libsectool.a ../../../../dist/AIX5.3_OPT.OBJ/lib symlink creation race: /share/builds/mccrel3/security/securitytip/builds/20081212.1/wozzeck_Solaris8/mozilla/dist/AIX5.3_OPT.OBJ/lib/libsectool.a nsinstall: symlink was attempted in working directory /share/builds/mccrel3/security/securitytip/builds/20081212.1/wozzeck_Solaris8/mozilla/security/nss/cmd/lib from ../../../security/nss/cmd/lib/AIX5.3_OPT.OBJ/libsectool.a to /share/builds/mccrel3/security/securitytip/builds/20081212.1/wozzeck_Solaris8/mozilla/dist/AIX5.3_OPT.OBJ/lib/libsectool.a. : File exists gmake[3]: *** [libs] Resource lost Link: /share/builds/mccrel3/security/securitytip/builds/20081212.1/wozzeck_Solaris8/mozilla/dist/AIX5.3_OPT.OBJ/lib/libsectool.a -> ../../../security/nss/cmd/lib/AIX5.3_OPT.OBJ/libsectool.a
Has this bug been reported to IBM yet? If not, let's do so ASAP. Also, I wonder if we should attempt a workaround for AIX (only) wherein nsinstall treats EEXIST like a successful outcome when it comes from a call to symlink(). Of course, in general, that is not safe, but perhaps in the limited context of our builds, it would be OK.
Nelson, If you look carefully at the log info from nsinstall in comment 21, you will see that we were trying to copy from /share/builds/mccrel3/security/securitytip/builds/20081212.1/wozzeck_Solaris8/mozilla/security/nss/cmd/lib/../../../security/nss/cmd/lib/AIX5.3_OPT.OBJ/libsectool.a , ie. from /share/builds/mccrel3/security/securitytip/builds/20081212.1/wozzeck_Solaris8/mozilla/security/security/nss/cmd/lib/AIX5.3_OPT.OBJ/libsectool.a Notice the security/security in the "from" path. If there is a bug in AIX, I am not sure what it is, but I don't think this failure of nsinstall is an OS bug. We are trying to link from a path that doesn't exist, so it is correct for it to fail. The question is, why are we doing that once in a while ? It could be a bug in the AIX version of gmake. We may have to trace what's going on at the Makefile level.
Build: 20090121.1/nssaixb_AIX5.3 Log: --- cd dbtest; /share/builds/mccrel3/security/tools/aix/gmake libs gmake[3]: Entering directory `/share/builds/mccrel3/security/securitytip/builds/20090121.1/wozzeck_Solaris8/mozilla/security/nss/cmd/dbtest' xlc_r -o AIX5.3_OPT.OBJ/dbtest.o -c -O -qmaxmem=-1 -DAIX -DSYSV -DXP_UNIX -UDEBUG -DNDEBUG -DNSS_ENABLE_ECC -DNSS_ECC_MORE_THAN_SUITE_B -DUSE_UTIL_DIRECTLY -I../../../../dist/AIX5.3_OPT.OBJ/include -I../../../../dist/public/nss -I../../../../dist/private/nss -I../../../../dist/public/seccmd -I../../../../dist/public/dbm /share/builds/mccrel3/security/securitytip/builds/20090121.1/wozzeck_Solaris8/mozilla/security/nss/cmd/dbtest/dbtest.c xlc_r -o AIX5.3_OPT.OBJ/dbtest -O -qmaxmem=-1 -DAIX -DSYSV -DXP_UNIX -UDEBUG -DNDEBUG -DNSS_ENABLE_ECC -DNSS_ECC_MORE_THAN_SUITE_B -DUSE_UTIL_DIRECTLY -I../../../../dist/AIX5.3_OPT.OBJ/include -I../../../../dist/public/nss -I../../../../dist/private/nss -I../../../../dist/public/seccmd -I../../../../dist/public/dbm AIX5.3_OPT.OBJ/dbtest.o ../../../../dist/AIX5.3_OPT.OBJ/lib/libsectool.a -brtl -L../../../../dist/AIX5.3_OPT.OBJ/lib -lssl3 -lsmime3 -lnss3 -lnssutil3 -L../../../../dist/AIX5.3_OPT.OBJ/lib -lplc4 -lplds4 -lnspr4 -blibpath:/usr/lib:/lib -lc -lm ../../../coreconf/nsinstall/AIX5.3_OPT.OBJ/nsinstall -R -m 775 AIX5.3_OPT.OBJ/dbtest ../../../../dist/AIX5.3_OPT.OBJ/bin symlink creation race: /share/builds/mccrel3/security/securitytip/builds/20090121.1/wozzeck_Solaris8/mozilla/dist/AIX5.3_OPT.OBJ/bin/dbtest nsinstall: symlink was attempted in working directory /share/builds/mccrel3/security/securitytip/builds/20090121.1/wozzeck_Solaris8/mozilla/security/nss/cmd/dbtest from ../../../security/nss/cmd/dbtest/AIX5.3_OPT.OBJ/dbtest to /share/builds/mccrel3/security/securitytip/builds/20090121.1/wozzeck_Solaris8/mozilla/dist/AIX5.3_OPT.OBJ/bin/dbtest. : File exists gmake[3]: *** [libs] Resource lost ---
Build 20090127.1/nssaixb_AIX5.3 Log: --- xlc_r -o AIX5.3_64_DBG.OBJ/p7sign -g -DAIX -DSYSV -DAIX_64BIT -DXP_UNIX -DDEBUG -UNDEBUG -DDEBUG_svbld -DNSS_ENABLE_ECC -DNSS_ECC_MORE_THAN_SUITE_B -DUSE_UTIL_DIRECTLY -I../../../../dist/AIX5.3_64_DBG.OBJ/include -I../../../../dist/public/nss -I../../../../dist/private/nss -I../../../../dist/public/seccmd AIX5.3_64_DBG.OBJ/p7sign.o ../../../../dist/AIX5.3_64_DBG.OBJ/lib/libsectool.a -brtl -L../../../../dist/AIX5.3_64_DBG.OBJ/lib -lssl3 -lsmime3 -lnss3 -lnssutil3 -L../../../../dist/AIX5.3_64_DBG.OBJ/lib -lplc4 -lplds4 -lnspr4 -blibpath:/usr/lib:/lib -lc -lm ../../../coreconf/nsinstall/AIX5.3_64_DBG.OBJ/nsinstall -R -m 775 AIX5.3_64_DBG.OBJ/p7sign ../../../../dist/AIX5.3_64_DBG.OBJ/bin symlink creation race: /share/builds/mccrel3/security/securitytip/builds/20090127.1/wozzeck_Solaris8/mozilla/dist/AIX5.3_64_DBG.OBJ/bin/p7sign nsinstall: symlink was attempted in working directory /share/builds/mccrel3/security/securitytip/builds/20090127.1/wozzeck_Solaris8/mozilla/security/nss/cmd/p7sign from ../../../security/nss/cmd/p7sign/AIX5.3_64_DBG.OBJ/p7sign to /share/builds/mccrel3/security/securitytip/builds/20090127.1/wozzeck_Solaris8/mozilla/dist/AIX5.3_64_DBG.OBJ/bin/p7sign. : File exists gmake[3]: *** [libs] Resource lost ---
It seems that it tries to replace existing file p7sign with symlink pointing to itself. Reassigning this bug to Christophe, because this seems to be more RE than QA issue.
Assignee: slavomir.katuscak → christophe.ravel.bugs
Unsetting target milestone in unresolved bugs whose targets have passed.
Target Milestone: 3.12.1 → ---

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: christophe.ravel.bugs → nobody
Severity: normal → S3
Severity: S3 → S4
Status: NEW → RESOLVED
Closed: 3 years ago
Priority: -- → P5
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: