Open
Bug 77869
Opened 24 years ago
Updated 3 years ago
nss tools should call PL_DestroyOptState to free optstate
Categories
(NSS :: Tools, defect, P5)
Tracking
(Not tracked)
ASSIGNED
People
(Reporter: zhou.bin, Unassigned)
Details
Attachments
(1 file, 1 obsolete file)
|
131.92 KB,
patch
|
Details | Diff | Splinter Review |
Comment 1•24 years ago
|
||
Thank you very much for the bug report. Yes, these are
memory leaks. These one-time memory leaks are not serious
and it is not urgent to fix them, so I am setting the
priority to P5 and target milestone to Future.
If you have patches for these tools, we will be happy to
review them.
Assignee: wtc → kirke
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P5
Target Milestone: --- → Future
Comment 2•23 years ago
|
||
Changed the QA contact to Bishakha.
QA Contact: sonja.mirtitsch → bishakhabanerjee
Updated•22 years ago
|
Target Milestone: Future → ---
Updated•21 years ago
|
Assignee: kirk.erickson → wchang0222
Summary: In many nss tools's sources (such as client.exe,server.exe) ,they call PL_CreateOptState to create options,but they do not call PL_DestroyOptState to free it. → nss tools should call PL_DestroyOptState to free optstate
Updated•20 years ago
|
QA Contact: bishakhabanerjee → jason.m.reid
Updated•19 years ago
|
Assignee: wtchang → nobody
QA Contact: jason.m.reid → tools
Updated•19 years ago
|
Assignee: nobody → biswatosh.chakraborty
Comment 3•18 years ago
|
||
It touches files in nss/cmd only as this problem is not applicable
in others.
In some files, PL_DestroyOptState() was called after the while
loop but then
not called in the case of error conditions inside the while loop, such as
inside :
while ((optstatus = PL_GetNextOpt(optstate)) == PL_OPT_OK) {...}
I added the call in those places as well.
Wherever, after such a while loop, I found this call missing, I added
it there too.
Attachment #278036 -
Flags: review?(neil.williams)
Updated•18 years ago
|
Status: NEW → ASSIGNED
Updated•18 years ago
|
Attachment #278036 -
Flags: review?(neil.williams) → review?(julien.pierre.boogz)
Comment 4•18 years ago
|
||
Comment on attachment 278036 [details] [diff] [review]
Calls PL_DestroyOptState whereever required in nss/cmd tools
The patch may be correct, but this code is not maintainable. Repeating the destroy call so many times in so many different places is going to lead to errors when new options are added and the cleanup is forgotten.
It would be much better to do the cleanup in one place, and have goto statements in this case. The error paths can set a variable before the goto to cause the function to exit after the destroy.
Please rewrite the patch with at most one PL_DestroyOptState call per PL_CreateOptState call.
Attachment #278036 -
Flags: review?(julien.pierre.boogz) → review-
Comment 5•18 years ago
|
||
Julien,
Please see whether this patch is doing what you had suggested in
Comment #4.
Although this bug has priority 5 but it covers majority files under
nss/cmd for which any mistake in my patch could be very crucial.
I tested with all.sh on Linux machine and it passes all tests
except ssl.sh successfully everytime. It passes ssl.sh many times
but sometimes stops at some line(in stress tests) and does not
proceed for a long time. But, ssl.sh uses tstclnt, strsclnt, selfserv,
certutil, modutil and crlutil only (directly or indirectly) and my patch
doesnot not change any one of those. I even tried all.sh with original
library(unchanged) and a couple of times it fails because of (PR_Bind,
"Address in use") issue or it stops for quite some time in stress tests.
Hence, I think, it is safe enough to give it for review now.
Attachment #278036 -
Attachment is obsolete: true
Attachment #288451 -
Flags: review?(julien.pierre.boogz)
Comment 6•18 years ago
|
||
Biswatosh,
The bind issue is a known pre-existing bug, bug 348198 . Your patch probably didn't affect it. I will take a look at it.
Comment 7•16 years ago
|
||
Comment on attachment 288451 [details] [diff] [review]
Patch 2
I am afraid this patch is bitrotten, so I'm cancelling the review request.
Attachment #288451 -
Flags: review?(julien.pierre.boogz)
Updated•16 years ago
|
Assignee: biswatosh2001 → nobody
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•