When running the NSS test suite on 64-bit HP-UX 11.00, sdrtest (the very first test) hangs. Attaching the debugger to the process shows that the process is in the PK11_GetSlotList function, with the argument 'type' = CKM_INVALID_MECHANISM. The 'top' command shows that sdrtest consumes 100% CPU, indicating a tight spin. But the only thing in the PK11_GetSlotList is a switch statement. How can a switch statement go into an infinite loop? This really looks like a compiler bug. Note that this is a debug build so no compiler optimizations are enabled. Some more info: 1. The 'type' argument is of the type CK_MECHANISM, which is 'unsigned long int'. 2. CKM_INVALID_MECHANISM is a macro with the value 0xffffffffL.
Please review the patch (id=16193) to ensure that it is semantically equivalent to the original code. In the interest of time, I propose that we check in this workaround for 3.1 and examine the compiler generated code after 3.1 is done.
Status: NEW → ASSIGNED
I checked in the workaround so that it will be picked up by tonight's nightly build. /cvsroot/mozilla/security/nss/lib/pk11wrap/pk11slot.c, new revision: 1.7
I wonder why I haven't seen this in any of my HP-64 testing on charm.
Target Milestone: --- → 3.1
It seems to me this bug is actually fixed in NSS 3.2. Shouldn't it be marked that way?
Nelson: I checked in a workaround in NSS 3.1. I am leaving this bug open because I am curious as to why we can ever get into an infinite loop in a simple switch statement. Either this is a compiler bug or our code is not quite correct for 64-bit compilation. We have a possibly related problem on 64-bit AIX, in two other files but also involving switch statements and the type CK_MECHANISM, which we have worked around by always compiling those two files with -O2. (See bug #63815.) What's common is that both bugs affect 64-bit OS's. What's different is that this bug is a run-time problem while bug #63815 is a compilation problem.
Changed the QA contact to Bishakha.
QA Contact: sonja.mirtitsch → bishakhabanerjee
QA Contact: bishakhabanerjee → jason.m.reid
This bug is either FIXED or WONTFIX. Wan-Teh, please dispose of it.
Target Milestone: Future → ---
Marked the bug fixed. I will see if the workaround can be removed with the current HP C compiler on HP-UX 11.11.
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.11
You need to log in before you can comment on or make changes to this bug.