Closed
Bug 430544
Opened 17 years ago
Closed 2 years ago
Solve the leak of PLArenas in NSS tools
Categories
(NSS :: Tools, defect, P5)
NSS
Tools
Tracking
(Not tracked)
RESOLVED
INACTIVE
People
(Reporter: wtc, Unassigned)
References
Details
Attachments
(1 file)
|
589 bytes,
patch
|
wtc
:
review+
|
Details | Diff | Splinter Review |
Since NSS uses PLArena's extensively, any NSS tool that calls PR_Cleanup should also call PL_ArenaFinish (right before the PR_Cleanup call) to destroy NSPR's internal PLArena freelist.
Comment 2•16 years ago
|
||
Should we just make NSS_Shutdown call this function?
That would fix all the tools and customer programs, too, in one blow.
And if the customer programs are already calling it (fat chance!) it
wouldn't hurt if it gets called twice, I think.
| Reporter | ||
Comment 3•16 years ago
|
||
NSS_Shutdown can't call PL_ArenaFinish or PR_Cleanup because
the application may continue to use PLArena or NSPR after
shutting down NSS.
We can add a SECU_Shutdown function that does
NSS_Shutdown
PL_ArenaFinish
PR_Cleanup
or add a SECU_ShutdownNSPR function that does
PL_ArenaFinish
PR_Cleanup
to share the common shutdown sequence in the command-line
tools.
Comment 5•15 years ago
|
||
If NSS can't clean them up, could/should NSPR clean up the arenas at the very least? I assume that if the arenas need NSPR, NSPR can clean them up safely. If not, it should probably be documented.
Comment 6•15 years ago
|
||
I think you're suggesting that PR_Cleanup could call PL_ArenaFinish.
IIRC, the reason we don't do that is to avoid circular dependencies
between NSPR's shared libraries. NSPR has 3 or 4 shared libs in all.
We let all the libs depend on libnspr4, but we don't let libnspr4
depend on any of the others.
Now, some ways to work around that might include:
a) having a way for the other libs to dynamically register shut down
functions with libnspr, so that libnspr's PR_Cleanup can call those
shutdown functions without being linked against those libs.
b) create Cleanup functions in the other libs, e.g. PL_Cleanup, that
call PR_Cleanup, and convert NSS's test programs to call PL_Cleanup
instead of PR_Cleanup.
Updated•15 years ago
|
Summary: NSS tools should call PL_ArenaFinish on shutdown → Solve the leak of PLArenas in NSS tools
Comment 7•15 years ago
|
||
Attachment #461053 -
Flags: review?(wtc)
| Reporter | ||
Comment 8•15 years ago
|
||
Comment on attachment 461053 [details] [diff] [review]
certutil-arenafinish.diff (checked in)
r=wtc. I checked in this patch on the NSS trunk (NSS 3.13).
Checking in certutil.c;
/cvsroot/mozilla/security/nss/cmd/certutil/certutil.c,v <-- certutil.c
new revision: 1.150; previous revision: 1.149
done
Attachment #461053 -
Attachment description: certutil-arenafinish.diff → certutil-arenafinish.diff (checked in)
Attachment #461053 -
Flags: review?(wtc) → review+
Updated•3 years ago
|
Severity: minor → S4
Updated•2 years ago
|
Status: NEW → RESOLVED
Closed: 2 years ago
Priority: -- → P5
Resolution: --- → INACTIVE
You need to log in
before you can comment on or make changes to this bug.
Description
•