If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

PKIX uses arenas without any freelists

RESOLVED DUPLICATE of bug 391244

Status

NSS
Libraries
--
major
RESOLVED DUPLICATE of bug 391244
10 years ago
10 years ago

People

(Reporter: dbaron, Assigned: Alexei Volkov)

Tracking

(Depends on: 1 bug, {mlk})

Dependency tree / graph
Bug Flags:
blocking1.9 ?

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: PKIX)

(Reporter)

Description

10 years ago
This bug is filed based on the NSS_3_12_ALPHA1B tag, which is what is currently used by the trunk of Firefox, etc.

PKIX seems to allocate significant numbers of objects out of an arena (created with a PORT_NewArena call in PKIX_PL_NssContext_Create) for the lifetime of NSS.  When these objects are destroyed, they are not placed on any freelist for recycling; instead the arena pools just grow as more objects are created and destroyed.  PKIX_PL_Realloc and PKIX_PL_Free do nothing with the freed memory when context != NULL && context->arena != NULL.  This means that the memory used grows over the lifetime of the application, even though the leak won't show up with many memory leak tools if is all freed in the PORT_FreeArena call in PKIX_PL_NssContext_Destroy during shutdown.
Flags: blocking1.9?
This seems like a duplicate of bug 391775.  They're the same issue, I think.
And both bugs seem to be dupliates of bug 391244.

David, did you actually experience these leaks? 
or did you merely find them by code inspection?  
I ask because, except for the PKIX initialization code (and shutdown code), 
all of libPKIX should be unused in FireFox at this time. 
Assignee: nobody → alexei.volkov.bugs
OS: Windows XP → All
Hardware: PC → All
Whiteboard: PKIX
Target Milestone: --- → 3.12
Version: 3.12 → trunk
Depends on: 391815
(Reporter)

Comment 2

10 years ago
I found this by code inspection after observing bug 391775.
This is a duplicate of 391244.  
I think the solution to this bug, which uses arenapools whose scope matches
the scope of the objects and/or functions being performed, will not (by itself)
resolve bug 391775, which is why I'm not marking it as a duplicate (although
they are clearly related).
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 391244
You need to log in before you can comment on or make changes to this bug.