Closed Bug 369444 Opened 18 years ago Closed 18 years ago

Invalid sidCacheEntry size assertion is failing

Categories

(NSS :: Libraries, defect, P2)

x86
All
defect

Tracking

(Not tracked)

RESOLVED FIXED
3.11.7

People

(Reporter: glenbeasley, Assigned: glenbeasley)

References

Details

Attachments

(1 file, 3 obsolete files)

attempting to port JSS to Intel Mac OS X java -Djava.library.path=/Users/b/tip/mozilla/dist/Darwin8.8.1_DBG.OBJ/lib -classpath ./jss4.jar org.mozilla.jss.tests.SSLClientAuth . passwords main: jss library loaded ***FilePasswordCallback returns netscape Assertion failure: sizeof(sidCacheEntry) % 8 == 0, at sslsnce.c:1158 Abort trap http://lxr.mozilla.org/security/source/security/nss/lib/ssl/sslsnce.c#1158
Attached patch added check for DARWIN "MAC OS X (obsolete) (deleted) — Splinter Review
Attachment #254123 - Attachment description: added define for DARWIN "MAC OS X → added check for DARWIN "MAC OS X
Attachment #254123 - Attachment is patch: true
Attachment #254123 - Attachment mime type: application/octet-stream → text/plain
Attachment #254123 - Flags: review?(nelson)
Assignee: nobody → glen.beasley
Status: ASSIGNED → NEW
Blocks: 369660
Comment on attachment 254123 [details] [diff] [review] added check for DARWIN "MAC OS X This patch will turn off that assertion for a third platform. Perhaps we should just remove that assertion.
Attached patch remove assertion (obsolete) (deleted) — Splinter Review
Attachment #254123 - Attachment is obsolete: true
Attachment #254380 - Flags: review?(wtchang)
Attachment #254123 - Flags: review?(nelson)
Comment on attachment 254380 [details] [diff] [review] remove assertion guys, that assertion is there to enforce a property of the cace upon which the design depends. it detects when some change has made the cache entry size invalid. don't eliminate the assertion. Fix the code so that the size of the entry becomes valid.
Attachment #254380 - Flags: superreview-
Summary: assertion failure on sidCacheEntry → Invalid sidCacheEntry size detected by aasertion
Comment on attachment 254380 [details] [diff] [review] remove assertion Nelson, in rev. 1.11 of sslsnce.c you turned off the assertion on Solaris/x86. This is what made me wonder if the assertion can be simply removed. I just took a look at the code. As far as I can tell, the code doesn't depend on the size of sidCacheEntry being a multiple of 8. When the InitCache function sets the cache->sidCacheData pointer, that pointer is aligned at 16-byte boundary (SID_ALIGNMENT is 16). We can put an object of any size at 16-byte boundary and satisfy the object's alignment requirement. So the assertion seems to be an "informational" assertion. Glen, the printf statement inside if defined(DEBUG_nelsonb) is closely related to the assertion, so the printf statement should also be removed if we remove the assertion. But let's hear what Nelson thinks is the proper fix first.
Attachment #254380 - Flags: review?(wtchang)
Comment on attachment 254380 [details] [diff] [review] remove assertion Glen, you should also study the code in sslsnce.c to find out if the code depends on the size of sidCacheEntry being a multiple of 8 or sidCacheEntry being 8-byte aligned.
this bug also occurs in the NSS tests. tstclnt -p 8443 -h tq.localhost -q \ -d ../client < /Users/b/tip/mozilla/security/nss/tests/ssl/sslreq.dat Assertion failure: sizeof(sidCacheEntry) % 8 == 0, at sslsnce.c:1158
Glen and I discussed this some more. I now recommend these changes: 1) change that assertion to (sizeof(sidCacheEntry) % 16 == 0) and make it work on all platforms with no exceptions 2) Change the following structure: -#if defined(LINUX) /* XXX Why only on Linux ? */ -struct { +struct { /* force sizeof(sidCacheEntry) to be a multiple of cache line size */ - PRUint8 filler[144]; /* XXX why this number ? */ + PRUint8 filler[120]; /* 72+120==196, a multiple of 16 */ } forceSize; -#endif
Attachment #254380 - Attachment is obsolete: true
Attachment #263641 - Flags: superreview?(wtc)
Attachment #263641 - Flags: review?(nelson)
Attachment #263641 - Attachment is obsolete: true
Attachment #263642 - Flags: superreview?(wtc)
Attachment #263642 - Flags: review?(nelson)
Attachment #263641 - Flags: superreview?(wtc)
Attachment #263641 - Flags: review?(nelson)
Comment on attachment 263642 [details] [diff] [review] fix typo of comment sidCacheEntry==192 r=nelson
Attachment #263642 - Flags: review?(nelson) → review+
Comment on attachment 263642 [details] [diff] [review] fix typo of comment sidCacheEntry==192 r=wtc. >+ PORT_Assert(sizeof(sidCacheEntry) % 16 == 0); I would recommend a stronger assertion instead: PORT_Assert(sizeof(sidCacheEntry) == 192);
Attachment #263642 - Flags: superreview?(wtc) → superreview+
Summary: Invalid sidCacheEntry size detected by aasertion → Invalid sidCacheEntry size assertion is failing
Trunk: Checking in sslsnce.c; /cvsroot/mozilla/security/nss/lib/ssl/sslsnce.c,v <-- sslsnce.c new revision: 1.40; previous revision: 1.39 done 3_11_BRANCH /cvsroot/mozilla/security/nss/lib/ssl/sslsnce.c,v <-- sslsnce.c new revision: 1.36.2.4; previous revision: 1.36.2.3 done
Status: NEW → RESOLVED
Closed: 18 years ago
OS: Mac OS X → All
Resolution: --- → FIXED
Target Milestone: --- → 3.11.7
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: