Closed
Bug 222065
Opened 21 years ago
Closed 21 years ago
SSL_ShutdownServerSessionIDCache leaks the cache memory
Categories
(NSS :: Libraries, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
3.8.3
People
(Reporter: nelson, Assigned: nelson)
References
Details
Attachments
(2 files, 1 obsolete file)
17.51 KB,
patch
|
wtc
:
review+
|
Details | Diff | Splinter Review |
898 bytes,
patch
|
nelson
:
review+
rrelyea
:
superreview+
|
Details | Diff | Splinter Review |
SSL_ShutdownServerSessionIDCache does not free the process's copy of the
(possibly shared) memory that contains the cache data. Consequently, all
that memory is leaked.
SSL_ShutdownServerSessionIDCache was created as part of the resolution of
bug 199082. A "preliminary" version of the patch was checked in, but the
work was not complete. Then the bug was marked resolved/fixed. Then it
fell off the radar. No bug was created to track the fact that the work
was undone, until now.
Assignee | ||
Comment 1•21 years ago
|
||
Marking P1 for NSS 3.9
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → 3.9
Comment 2•21 years ago
|
||
We need to put the fix on the 3.8 branch as well. Setting target
milestone 3.8.3.
Target Milestone: 3.9 → 3.8.3
Assignee | ||
Comment 3•21 years ago
|
||
This patch appears to be correct for single-process servers.
I believe it is no worse than before for multi-process servers.
There is some code specifically for WINNT builds (using the NT version of NSPR)
and I have not yet tested that code. I will do so before checking anything in.
I have also found a large number of memleaks whose allocation stacks all have
this in common:
calloc [MSVCRT.DLL]
PR_Calloc [prmem.c:484]
PR_NewLock [prulock.c:194]
secmodCreateMutext [pk11load.c:61]
/* build the PKCS #11 2.01 lock files */
CK_RV PR_CALLBACK secmodCreateMutext(CK_VOID_PTR_PTR pmutex) {
=> *pmutex = (CK_VOID_PTR) PZ_NewLock(nssILockOther);
if ( *pmutex ) return CKR_OK;
return CKR_HOST_MEMORY;
}
It appears these locks are never freed.
Assignee | ||
Updated•21 years ago
|
Attachment #133538 -
Flags: review?(wchang0222)
Comment 4•21 years ago
|
||
Comment on attachment 133538 [details] [diff] [review]
preliminaty patch v1
This patch is basically good, but it needs work.
1. The most serious problem is the #ifdef WINNT code
that calls sslMutex_2LevelDestroy. That piece of
code should be deleted because the subsequent
sslMutex_Destroy calls will call sslMutex_2LevelDestroy
on WINNT.
Please add a comment to explain why the
sslMutex_Destroy calls are only made if
cache->sharedCache->everInherited is false.
The reason is not obvious at all.
2. In SSL_InheritMPServerSIDCacheInstance, we
should do
>+ cache->sharedCache->everInherited = PR_TRUE;
right before we set isMultiProcess to PR_TRUE
and return SECSuccess. At least, there must not
be any "goto loser" statement after we set
cache->sharedCache->everInherited to PR_TRUE.
Please add a comment to explain the purpose of the
local variable "my".
Attachment #133538 -
Flags: review?(wchang0222) → review-
Assignee | ||
Comment 5•21 years ago
|
||
Please also review the patch for bug 222726, which is related to this bug.
Attachment #133538 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #133604 -
Flags: review?(wchang0222)
Comment 6•21 years ago
|
||
Comment on attachment 133604 [details] [diff] [review]
patch v2 - addressing Wan-Teh's comments
I verified that all the changes I suggested have been made.
r=wtc.
Attachment #133604 -
Flags: review?(wchang0222) → review+
Assignee | ||
Comment 7•21 years ago
|
||
Fix checked in on both trunk and NSS 3.8 branch.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 8•21 years ago
|
||
I reviewed Nelson's patch again and found a bug in a piece
of code that is only used by the WINNT build for servers.
We should not set cache->sidCacheLocks to newLocks before
the memcpy call, otherwise the memcpy call will copy the
newLocks array onto itself.
This supplemental patch fixes that bug.
Updated•21 years ago
|
Attachment #133722 -
Flags: review?(MisterSSL)
Updated•21 years ago
|
Attachment #133722 -
Flags: superreview?(rrelyea0264)
Assignee | ||
Comment 9•21 years ago
|
||
Comment on attachment 133722 [details] [diff] [review]
Supplemental patch
r=MisterSSL
Attachment #133722 -
Flags: review?(MisterSSL) → review+
Comment 10•21 years ago
|
||
The supplemental patch has been checked in on both trunk
and NSS 3.8 branch.
Updated•21 years ago
|
Attachment #133722 -
Flags: superreview?(rrelyea0264) → superreview+
You need to log in
before you can comment on or make changes to this bug.
Description
•