Crash [@ ReadDBEntry ]
Categories
(NSS :: Libraries, defect)
Tracking
(firefox51+ wontfix, firefox52- fixed, firefox53+ fixed)
People
(Reporter: cbook, Assigned: franziskus)
References
()
Details
(Keywords: crash, Whiteboard: [adv-main52+])
Attachments
(2 files)
Reporter | ||
Comment 1•8 years ago
|
||
Comment 4•8 years ago
|
||
Updated•8 years ago
|
Comment 5•8 years ago
|
||
Comment 6•8 years ago
|
||
Assignee | ||
Comment 7•8 years ago
|
||
Reporter | ||
Comment 8•8 years ago
|
||
Comment 9•8 years ago
|
||
Assignee | ||
Comment 10•8 years ago
|
||
Assignee | ||
Comment 11•8 years ago
|
||
Comment 12•8 years ago
|
||
Comment 13•8 years ago
|
||
Comment 14•8 years ago
|
||
Assignee | ||
Comment 15•8 years ago
|
||
Comment 16•8 years ago
|
||
Comment 17•8 years ago
|
||
Assignee | ||
Comment 18•8 years ago
|
||
Comment 19•8 years ago
|
||
Updated•8 years ago
|
Assignee | ||
Comment 20•8 years ago
|
||
Updated•8 years ago
|
Comment 21•8 years ago
|
||
Comment 23•8 years ago
|
||
Updated•8 years ago
|
Updated•7 years ago
|
Comment 24•3 years ago
|
||
dbs_EmulateMap() causes a memory leak. Before this bug fix, dbs_EmulateMap() was only used on platforms that don't support memory mapping files. However, after this bug fix, dbs_EmulateMap() is used unconditionally, which leads to this memory leak applying to all systems that use legacydb.
More specifically:
Memory for the "data" DBT object that is populated by db->get() is normally managed by the DB library, and callers of db->get() do not need to free this memory. However, dbs_EmulateMap() in dbmshim.c uses PORT_Alloc() to allocate memory for the blob data, then returns this data from a wrapper that emulates db->get(). After that, nothing ever frees this memory; The caller assumes that this memory is managed by the library and doesn't need to be freed, the underlying database library has no knowledge of this memory allocated to hold the blob, and nothing in dbmshim.c ever subsequently frees it.
Given that the legacydb format is effectively dead, I'm not advocating that this memory leak be fixed ... But since I just wasted an afternoon hunting it down, I wanted to throw this out there somewhere that others might be able to find it.
Description
•