tracking - review memory menagement in libpkix

NEW
Assigned to

Status

NSS
Libraries
P1
normal
10 years ago
7 years ago

People

(Reporter: Alexei Volkov, Assigned: Alexei Volkov)

Tracking

(Depends on: 2 bugs)

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: PKIX)

(Assignee)

Description

10 years ago
LibPkix is designed so that every library function has a pointer to void as the last argument. Pointer to PKIX_PL_NssContext casted to void* is the actual data poiter that get passed to the library functions.

PRArenaPort* is one of the members of PKIX_PL_NssContext. If NssContext_Create is called with arena set to PKIX_TRUE, an arena pool will be created and used for majority of object allocations. 

There are two types of PKIX_PL_NssContext objects involved in operations of libpkix. First type is single global object that is allocated at pkix initialization time and mainly supposed to be used for cache memory allocations. Second type are PKIX_PL_NssContext objects allocated before every call of PKIX_BuildChain and used for new allocations during a particula cert chaing building or validation.

The design creates a problem when an arena is used by many threads to allocate multiple objects that will result in significant memory use growth as the most of the objects in cache wont be deallocated until library shutdown. Also, the cert/crl, etc date will need to be copied to global arena every time an object is cached.

As a part of this bug resolution one should deeply understand libpkix memory allocation. One of the possible solution is to use per object arena, but this approach will result in increased allocation sys calls.
(Assignee)

Updated

10 years ago
Whiteboard: PKIX
(Assignee)

Updated

10 years ago
Priority: -- → P1
(Assignee)

Comment 1

10 years ago
valid Nelson's comment from bug 389904#c8 that also should be addressed in this bug.
Summary: libpkix: use PKIX_PL_NssContext arena can create a problem if used for PKIX_PL_Cert data allocation → review memory menagement in libpkix
Duplicate of this bug: 391776
Version: 3.12 → trunk
(Assignee)

Updated

10 years ago
Depends on: 387024
Summary: review memory menagement in libpkix → tracking - review memory menagement in libpkix
(Assignee)

Updated

10 years ago
Depends on: 391775
(Assignee)

Updated

10 years ago
Target Milestone: 3.12 → 3.12.1
Target Milestone: 3.12.1 → 3.12.2
You need to log in before you can comment on or make changes to this bug.