Bug 3856 - 16 byte leak each time HTMLCollectionImpl::resetCollectionInfo() is called
Summary: 16 byte leak each time HTMLCollectionImpl::resetCollectionInfo() is called
Status: RESOLVED DUPLICATE of bug 4450
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P3 Minor
Assignee: Timothy Hatcher
URL: http://www.colloquy.info/test/childre...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-04 20:07 PDT by Timothy Hatcher
Modified: 2005-08-23 13:41 PDT (History)
0 users

See Also:


Attachments
Leaks output from Safari (23.47 KB, text/plain)
2005-07-04 20:07 PDT, Timothy Hatcher
no flags Details
Fix for the leaks (1.50 KB, patch)
2005-07-05 18:44 PDT, Timothy Hatcher
timothy: review-
Details | Formatted Diff | Diff
Crash that randomly happened (23.92 KB, text/plain)
2005-07-06 20:29 PDT, Timothy Hatcher
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2005-07-04 20:07:20 PDT
The linked page uses the children collection. This triggers a leak each time one of the collection items is 
accessed (since reset is called each time). Attached is a leaks output with the stack trace. Below is a short 
snip to aid in the search-ability of this info.

DOM::HTMLCollectionImpl::resetCollectionInfo() const | 
DOM::HTMLCollectionImpl::CollectionInfo::CollectionInfo[in-charge]() | KWQDictImpl::KWQDictImpl[in-
charge](int, bool, void (*)(void*)) | KWQPtrDictImpl::KWQPtrDictImpl[not-in-charge](int, void (*)(void*), 
CFDictionaryKeyCallBacks const*) | operator new(unsigned long) | malloc
Comment 1 Timothy Hatcher 2005-07-04 20:07:54 PDT
Created attachment 2798 [details]
Leaks output from Safari
Comment 2 Timothy Hatcher 2005-07-04 20:10:29 PDT
Custom built WebKit from TOT, July 4th 10:00 PM EST.
Comment 3 Timothy Hatcher 2005-07-04 21:59:30 PDT
I have started a fix for this. Should have a patch tomorrow when I have more time to test.
Comment 4 Timothy Hatcher 2005-07-05 18:44:51 PDT
Created attachment 2825 [details]
Fix for the leaks

Leaks were more extensive than initially thought. There were 2 NSCFDictionary
objects leaked, along with a few more ints, bools and long. A whole struct.
Comment 5 Timothy Hatcher 2005-07-06 14:47:37 PDT
Comment on attachment 2825 [details]
Fix for the leaks

THis patch causes a crash. I will investigate further. Don't review/land!
Comment 6 Timothy Hatcher 2005-07-06 20:29:07 PDT
Created attachment 2841 [details]
Crash that randomly happened

This is the crash I got randomly in a related area of my first patch.

The memory appears to be alloced and deleted correctly, accounting for the
possible shared collection info. Below is a log of the memory alloc and delete
process.

construct HTMLCollectionImpl(0x395c800) shared info(0x3a05bfc) type(13)
destruct HTMLCollectionImpl(0x395c800) kept info(0x3a05bfc)
construct HTMLCollectionImpl(0x395c800) blank info(0x0) type(14)
HTMLCollectionImpl(0x395c800) new info(0x56639a0) in
HTMLCollectionImpl::resetCollectionInfo()
construct HTMLCollectionImpl(0x143bec0) shared info(0x3a05bfc) type(13)
destruct HTMLCollectionImpl(0x143bec0) kept info(0x3a05bfc)
construct HTMLCollectionImpl(0x143bec0) blank info(0x0) type(14)
HTMLCollectionImpl(0x143bec0) new info(0x568b870) in
HTMLCollectionImpl::resetCollectionInfo()
construct HTMLCollectionImpl(0x396a8c0) blank info(0x0) type(14)
HTMLCollectionImpl(0x396a8c0) new info(0x1410c20) in
HTMLCollectionImpl::resetCollectionInfo()
construct HTMLCollectionImpl(0x567a0a0) blank info(0x0) type(14)
HTMLCollectionImpl(0x567a0a0) new info(0x39c6fe0) in
HTMLCollectionImpl::resetCollectionInfo()
construct HTMLCollectionImpl(0x140f8f0) blank info(0x0) type(14)
HTMLCollectionImpl(0x140f8f0) new info(0x56778c0) in
HTMLCollectionImpl::resetCollectionInfo()
construct HTMLCollectionImpl(0x1414320) blank info(0x0) type(14)
HTMLCollectionImpl(0x1414320) new info(0x5685dd0) in
HTMLCollectionImpl::resetCollectionInfo()
construct HTMLCollectionImpl(0x1455790) blank info(0x0) type(14)
HTMLCollectionImpl(0x1455790) new info(0x140f740) in
HTMLCollectionImpl::resetCollectionInfo()
construct HTMLCollectionImpl(0x5678570) blank info(0x0) type(14)
HTMLCollectionImpl(0x5678570) new info(0x56784f0) in
HTMLCollectionImpl::resetCollectionInfo()
construct HTMLCollectionImpl(0x140fab0) blank info(0x0) type(14)
HTMLCollectionImpl(0x140fab0) new info(0x56862b0) in
HTMLCollectionImpl::resetCollectionInfo()
construct HTMLCollectionImpl(0x1410b70) blank info(0x0) type(14)
HTMLCollectionImpl(0x1410b70) new info(0x567a260) in
HTMLCollectionImpl::resetCollectionInfo()
construct HTMLCollectionImpl(0x1424f70) blank info(0x0) type(14)
HTMLCollectionImpl(0x1424f70) new info(0x5691690) in
HTMLCollectionImpl::resetCollectionInfo()
construct HTMLCollectionImpl(0x5692e00) blank info(0x0) type(14)
HTMLCollectionImpl(0x5692e00) new info(0x5692360) in
HTMLCollectionImpl::resetCollectionInfo()
destruct HTMLCollectionImpl(0x395c800) deleted info(0x56639a0)
destruct HTMLCollectionImpl(0x143bec0) deleted info(0x568b870)
destruct HTMLCollectionImpl(0x396a8c0) deleted info(0x1410c20)
destruct HTMLCollectionImpl(0x567a0a0) deleted info(0x39c6fe0)
destruct HTMLCollectionImpl(0x140f8f0) deleted info(0x56778c0)
destruct HTMLCollectionImpl(0x1414320) deleted info(0x5685dd0)
destruct HTMLCollectionImpl(0x1455790) deleted info(0x140f740)
destruct HTMLCollectionImpl(0x5678570) deleted info(0x56784f0)
destruct HTMLCollectionImpl(0x140fab0) deleted info(0x56862b0)
destruct HTMLCollectionImpl(0x1410b70) deleted info(0x567a260)
destruct HTMLCollectionImpl(0x1424f70) deleted info(0x5691690)
destruct HTMLCollectionImpl(0x5692e00) deleted info(0x5692360)
Comment 7 John Sullivan 2005-08-17 15:43:48 PDT
This might be the same as 4450, which Maciej recently fixed. You might want to get Maciej to confirm this 
so you don't spend too much time on it.
Comment 8 John Sullivan 2005-08-23 13:41:18 PDT
Definitely the same as 4450, marking as duplicate.

*** This bug has been marked as a duplicate of 4450 ***