Open
Bug 126921
Opened 23 years ago
Updated 2 years ago
mismatches between C runtime library memory allocation functions and NSPR memory allocation functions
Categories
(NSS :: Libraries, defect, P3)
Tracking
(Not tracked)
NEW
People
(Reporter: julien.pierre, Unassigned)
Details
I believe we have many places in the NSS code where we are assuming PR_Free will work on a pointer allocated from the standard C lib. For example, in our headers, PR_Strdup is a macro to strdup (except on Mac). Then we try to free it with PR_Free. This can cause problems especially with the zone allocator. This scenario actually happens in the PKCS#11 module initialization code where the module name gets duplicated. It normally doesn't get exposed because PR_Free maps to free() most of the time, and works. Even with the zone allocator, if we don't find it in the zone map, we fall back to free(). This can mask many problems like double-frees. I actually ran into this on NT because I had a mismatch of runtime libraries for NSS, NSPR and the web server I was running on. NSPR was built in OBJD mode and the free caused an assertion in the MS runtime library. I would suggest that we should have a way to make the zone allocator assert in cases where the block to free isn't found in the zones. For NT we could force that to occur in the OBJD builds since we have to do them anyway. For other platforms I suggest an environment variable. Using that, we can then debug all of our invalid malloc/PR_Malloc vs PR_free/free assumptions and clean up our code.
Reporter | ||
Updated•23 years ago
|
Priority: -- → P2
Target Milestone: --- → 3.4.1
Comment 1•22 years ago
|
||
The PORT_Strdup problem that Julien mentioned has been fixed in bug 131057.
Status: NEW → ASSIGNED
Comment 2•22 years ago
|
||
Changed the QA contact to Bishakha.
QA Contact: sonja.mirtitsch → bishakhabanerjee
Reporter | ||
Updated•22 years ago
|
Target Milestone: 3.5 → 3.6
Updated•22 years ago
|
Target Milestone: 3.6 → 3.7
Comment 4•22 years ago
|
||
Moved to target milestone 3.8 because the original NSS 3.7 release has been renamed 3.8.
Target Milestone: 3.7 → 3.8
Comment 5•21 years ago
|
||
Remove target milestone of 3.8, since these bugs didn't get into that release.
Target Milestone: 3.8 → ---
Updated•21 years ago
|
Priority: P2 → P3
Updated•21 years ago
|
Target Milestone: 3.9 → ---
Updated•19 years ago
|
QA Contact: bishakhabanerjee → jason.m.reid
Updated•18 years ago
|
QA Contact: jason.m.reid → libraries
Updated•2 years ago
|
Assignee: wtc → nobody
Status: ASSIGNED → NEW
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•