[webkit-dev] Memory leaks

Husam Senussi husam at senussi.com
Wed May 13 12:32:43 PDT 2009


Hi,

Is the below command the correct one to test for memory leaks.

./WebKitTools/Scripts/run-webkit-tests --debug -l LayoutTests/http/ 
tests/xmlhttprequest

if so would /tmp/layout-test-results/DumpRenderTree-leaks.txt file be  
the right file to look for reported leaks.

I ran the test cases in the above directory and in test cases for JSON  
code and end up with reported leaks in the same ares,
I thought it might b something I have introduces but I can't find  
anything related to my code changes in the stack trace dump.

Was the above command the correct one to use !!!  or is it problem  
with my test case!!!!

Below fragment of the report in three different directory


  LayoutTests/http/tests/xmlhttprequest

Process 26489: 69079 nodes malloced for 8397 KB
Process 26489: 98 leaks for 4320 total leaked bytes.
Leak: 0x1c3359c0  size=96   instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation
     0xa036d4a0 0x0100078c 0x74746853 0x2f2f3a70     ..6.....Shttp://
     0x2e373231 0x2e302e30 0x30383a31 0x782f3030     127.0.0.1:8000/x
     0x74686c6d 0x65727074 0x73657571 0x65722f74     mlhttprequest/re
     0x72756f73 0x2f736563 0x69736162 0x75612d63     sources/basic-au
     0x622f6874 0x63697361 0x7475612d 0x68702e68     th/basic-auth.ph
     0x69753f70 0x6f6c3d64 0x316e6967 0x00000000     p?uid=login1....
     Call stack: [thread 0xa00ec720]: | 0x2 | start | main |  
dumpRenderTree(int, char const**) | runTestingServerLoop() |  
runTest(std::basic_string<char, std::char_traits<char>,  
std::allocator<char> > const&) | -[NSRunLoop(NSRunLoop)  
runMode:beforeDate:] | CFRunLoopRunInMode | CFRunLoopRunSpecific |  
MultiplexerSource::perform() | URLConnectionClient::processEvents() |  
URLConnectionClient 
::ClientConnectionEventQueue 
::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent,  
XClientEventParams>*, long) |  
URLConnectionClient 
::ClientConnectionEventQueue 
::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent,  
XClientEventParams>*, long) |  
URLConnectionClient::_clientDidReceiveData(__CFData const*,  
URLConnectionClient::ClientConnectionEventQueue*) |  
_NSURLConnectionDidReceiveData | - 
[NSURLConnection(NSURLConnectionReallyInternal)  
sendDidReceiveData:originalLength:] | - 
[WebCoreResourceHandleAsDelegate  
connection:didReceiveData:lengthReceived:] |  
WebCore::ResourceLoader::didReceiveData(WebCore::ResourceHandle*, char  
const*, int, int) | WebCore::MainResourceLoader::didReceiveData(char  
const*, int, long long, bool) |  
WebCore::ResourceLoader::didReceiveData(char const*, int, long long,  
bool) | WebCore::MainResourceLoader::addData(char const*, int, bool) |  
WebCore::FrameLoader::receivedData(char const*, int) |  
WebCore::DocumentLoader::receivedData(char const*, int) |  
WebCore::DocumentLoader::commitLoad(char const*, int) |  
WebCore::FrameLoader::committedLoad(WebCore::DocumentLoader*, char  
const*, int) |  
WebFrameLoaderClient::committedLoad(WebCore::DocumentLoader*, char  
const*, int) | -[WebDataSource(WebInternal) _receivedData:] | - 
[WebHTMLRepresentation receivedData:withDataSource:] | - 
[WebFrame(WebInternal) _receivedData:textEncodingName:] | - 
[WebFrame(WebInternal) _addData:] | WebCore::FrameLoader::addData(char  
const*, int) | WebCore::FrameLoader::write(char const*, int, bool) |  
WebCore::HTMLTokenizer::write(WebCore::SegmentedString const&, bool) |  
WebCore::HTMLTokenizer::parseTag(WebCore::SegmentedString&,  
WebCore::HTMLTokenizer::State) |  
WebCore::HTMLTokenizer::parseSpecial(WebCore::SegmentedString&,  
WebCore::HTMLTokenizer::State) |  
WebCore::HTMLTokenizer::scriptHandler(WebCore::HTMLTokenizer::State) |  
WebCore::HTMLTokenizer::scriptExecution(WebCore::ScriptSourceCode  
const&, WebCore::HTMLTokenizer::State) |  
WebCore::FrameLoader::executeScript(WebCore::ScriptSourceCode const&)  
| WebCore::ScriptController::evaluate(WebCore::ScriptSourceCode  
const&) | JSC::evaluate(JSC::ExecState*, JSC::ScopeChain&,  
JSC::SourceCode const&, JSC::JSValue) |  
JSC::Interpreter::execute(JSC::ProgramNode*, JSC::ExecState*,  
JSC::ScopeChainNode*, JSC::JSObject*, JSC::JSValue*) |  
JSC::JITCode::execute(JSC::RegisterFile*, JSC::ExecState*,  
JSC::JSGlobalData*, JSC::JSValue*) | 0xbfb20f |  
WebCore::jsXMLHttpRequestPrototypeFunctionSend(JSC::ExecState*,  
JSC::JSObject*, JSC::JSValue, JSC::ArgList const&) |  
WebCore::JSXMLHttpRequest::send(JSC::ExecState*, JSC::ArgList const&)  
| WebCore::XMLHttpRequest::send(int&) |  
WebCore::XMLHttpRequest::send(WebCore::String const&, int&) |  
WebCore::XMLHttpRequest::createRequest(int&) |  
WebCore::XMLHttpRequest::makeSameOriginRequest(int&) |  
WebCore 
::XMLHttpRequest::loadRequestSynchronously(WebCore::ResourceRequest&,  
int&) |  
WebCore 
::ThreadableLoader 
::loadResourceSynchronously(WebCore::ScriptExecutionContext*,  
WebCore::ResourceRequest const&, WebCore::ThreadableLoaderClient&,  
WebCore::StoredCredentials) |  
WebCore 
::DocumentThreadableLoader 
::loadResourceSynchronously(WebCore::Document*,  
WebCore::ResourceRequest const&, WebCore::ThreadableLoaderClient&,  
WebCore::StoredCredentials) |  
WebCore 
::FrameLoader::loadResourceSynchronously(WebCore::ResourceRequest  
const&, WebCore::StoredCredentials, WebCore::ResourceError&,  
WebCore::ResourceResponse&, WTF::Vector<char, 0ul>&) |  
WebCore::FrameLoader::requestFromDelegate(WebCore::ResourceRequest&,  
unsigned long&, WebCore::ResourceError&) |  
WebCore 
::FrameLoader::dispatchAssignIdentifierToInitialRequest(unsigned long,  
WebCore::DocumentLoader*, WebCore::ResourceRequest const&) |  
WebFrameLoaderClient::assignIdentifierToInitialRequest(unsigned long,  
WebCore::DocumentLoader*, WebCore::ResourceRequest const&) |  
WebCore::ResourceRequest::nsURLRequest() const |  
WebCore::ResourceRequestBase::updatePlatformRequest() const |  
WebCore::ResourceRequest::doUpdatePlatformRequest() |  
WebCore::KURL::operator NSURL*() const | WebCore::KURL::createCFURL()  
const | CFURLCreateAbsoluteURLWithBytes | CFStringCreateWithBytes |  
__CFStringCreateImmutableFunnel3 | _CFRuntimeCreateInstance |  
malloc_zone_malloc

LayoutTests/fast/js/JSON

Leak: 0xcae340  size=96 instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation
     0xa036d4a0 0x0100078c 0x5445474e 0x73552f20     ..6.....NGET /Us
     0x2f737265 0x61737568 0x65572f6d 0x74694b62     ers/husam/WebKit
     0x79614c2f 0x5474756f 0x73747365 0x7361662f     /LayoutTests/fas
     0x736a2f74 0x4f534a2f 0x65722f4e 0x72756f73     t/js/JSON/resour
     0x2f736563 0x73736170 0x736a2e31 0x48206e6f     ces/pass1.json H
     0x2f505454 0x00312e31 0x00000000 0x00000000     TTP/1.1.........
     Call stack: [thread 0xa00ec720]: | 0x2 | start | main |  
dumpRenderTree(int, char const**) | runTestingServerLoop() |  
runTest(std::basic_string<char, std::char_traits<char>,  
std::allocator<char> > const&) | -[NSRunLoop(NSRunLoop)  
runMode:beforeDate:] | CFRunLoopRunInMode | CFRunLoopRunSpecific |  
MultiplexerSource::perform() | URLConnectionClient::processEvents() |  
URLConnectionClient 
::ClientConnectionEventQueue 
::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent,  
XClientEventParams>*, long) |  
URLConnectionClient 
::_clientDidFinishLoading 
(URLConnectionClient::ClientConnectionEventQueue*) |  
_NSURLConnectionDidFinishLoading | - 
[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading]  
| -[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:] |  
WebCore::ResourceLoader::didFinishLoading(WebCore::ResourceHandle*) |  
WebCore::SubresourceLoader::didFinishLoading() |  
WebCore::Loader::Host::didFinishLoading(WebCore::SubresourceLoader*) |  
WebCore::CachedScript::data(WTF::PassRefPtr<WebCore::SharedBuffer>,  
bool) | WebCore::CachedScript::checkNotify() |  
WebCore::HTMLTokenizer::notifyFinished(WebCore::CachedResource*) |  
WebCore::HTMLTokenizer::write(WebCore::SegmentedString const&, bool) |  
WebCore::HTMLTokenizer::parseTag(WebCore::SegmentedString&,  
WebCore::HTMLTokenizer::State) |  
WebCore::HTMLTokenizer::parseSpecial(WebCore::SegmentedString&,  
WebCore::HTMLTokenizer::State) |  
WebCore::HTMLTokenizer::scriptHandler(WebCore::HTMLTokenizer::State) |  
WebCore::HTMLTokenizer::scriptExecution(WebCore::ScriptSourceCode  
const&, WebCore::HTMLTokenizer::State) |  
WebCore::FrameLoader::executeScript(WebCore::ScriptSourceCode const&)  
| WebCore::ScriptController::evaluate(WebCore::ScriptSourceCode  
const&) | JSC::evaluate(JSC::ExecState*, JSC::ScopeChain&,  
JSC::SourceCode const&, JSC::JSValue) |  
JSC::Interpreter::execute(JSC::ProgramNode*, JSC::ExecState*,  
JSC::ScopeChainNode*, JSC::JSObject*, JSC::JSValue*) |  
JSC::JITCode::execute(JSC::RegisterFile*, JSC::ExecState*,  
JSC::JSGlobalData*, JSC::JSValue*) | 0x133c20f |  
WebCore::jsXMLHttpRequestPrototypeFunctionSend(JSC::ExecState*,  
JSC::JSObject*, JSC::JSValue, JSC::ArgList const&) |  
WebCore::JSXMLHttpRequest::send(JSC::ExecState*, JSC::ArgList const&)  
| WebCore::XMLHttpRequest::send(int&) |  
WebCore::XMLHttpRequest::send(WebCore::String const&, int&) |  
WebCore::XMLHttpRequest::createRequest(int&) |  
WebCore::XMLHttpRequest::makeSameOriginRequest(int&) |  
WebCore 
::XMLHttpRequest::loadRequestSynchronously(WebCore::ResourceRequest&,  
int&) |  
WebCore 
::ThreadableLoader 
::loadResourceSynchronously(WebCore::ScriptExecutionContext*,  
WebCore::ResourceRequest const&, WebCore::ThreadableLoaderClient&,  
WebCore::StoredCredentials) |  
WebCore 
::DocumentThreadableLoader 
::loadResourceSynchronously(WebCore::Document*,  
WebCore::ResourceRequest const&, WebCore::ThreadableLoaderClient&,  
WebCore::StoredCredentials) |  
WebCore 
::FrameLoader::loadResourceSynchronously(WebCore::ResourceRequest  
const&, WebCore::StoredCredentials, WebCore::ResourceError&,  
WebCore::ResourceResponse&, WTF::Vector<char, 0ul>&) |  
WebCore 
::ResourceHandle::loadResourceSynchronously(WebCore::ResourceRequest  
const&, WebCore::StoredCredentials, WebCore::ResourceError&,  
WebCore::ResourceResponse&, WTF::Vector<char, 0ul>&, WebCore::Frame*)  
| -[NSObject mutableCopy] | -[NSURLRequest mutableCopyWithZone:] |  
_createRequestCopy(__CFAllocator const*, _CFURLRequest const*,  
unsigned char) | URLRequest::initialize(URLRequest const*, unsigned  
char) | HTTPRequest::HTTPRequest(__CFAllocator const*, HTTPRequest  
const*) | CFHTTPMessageCreateCopy |  
HTTPMessage::initialize(HTTPMessage*) | CFStringCreateCopy |  
__CFStringCreateImmutableFunnel3 | _CFRuntimeCreateInstance |  
malloc_zone_malloc


LayoutTests/fast/parser

Process 27035: 47034 nodes malloced for 6207 KB
Process 27035: 10 leaks for 384 total leaked bytes.
Leak: 0xc7c710  size=96 instance of 'NSCFString', type ObjC,  
implemented in CoreFoundation
     0xa036d4a0 0x0100078c 0x6c696650 0x2f2f3a65     ..6.....Pfile://
     0x6573552f 0x682f7372 0x6d617375 0x6265572f     /Users/husam/Web
     0x2f74694b 0x6f79614c 0x65547475 0x2f737473     Kit/LayoutTests/
     0x74736166 0x7261702f 0x2f726573 0x65747865     fast/parser/exte
     0x6c616e72 0x746e652d 0x65697469 0x6e692d73     rnal-entities-in
     0x6c73782d 0x6d782e74 0x0000006c 0x00000000     -xslt.xml.......
     Call stack: [thread 0xa00ec720]: | 0x2 | start | main |  
dumpRenderTree(int, char const**) | runTestingServerLoop() |  
runTest(std::basic_string<char, std::char_traits<char>,  
std::allocator<char> > const&) | -[NSRunLoop(NSRunLoop)  
runMode:beforeDate:] | CFRunLoopRunInMode | CFRunLoopRunSpecific |  
MultiplexerSource::perform() | URLConnectionClient::processEvents() |  
URLConnectionClient 
::ClientConnectionEventQueue 
::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent,  
XClientEventParams>*, long) |  
URLConnectionClient 
::_clientDidFinishLoading 
(URLConnectionClient::ClientConnectionEventQueue*) |  
_NSURLConnectionDidFinishLoading | - 
[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading]  
| -[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:] |  
WebCore::ResourceLoader::didFinishLoading(WebCore::ResourceHandle*) |  
WebCore::SubresourceLoader::didFinishLoading() |  
WebCore::Loader::Host::didFinishLoading(WebCore::SubresourceLoader*) |  
WebCore 
::CachedXSLStyleSheet::data(WTF::PassRefPtr<WebCore::SharedBuffer>,  
bool) | WebCore::CachedXSLStyleSheet::checkNotify() |  
WebCore::ProcessingInstruction::setXSLStyleSheet(WebCore::String  
const&, WebCore::String const&) |  
WebCore::ProcessingInstruction::parseStyleSheet(WebCore::String  
const&) | WebCore::XSLStyleSheet::parseString(WebCore::String const&,  
bool) | xmlParseEntity | xmlParseDocument | xmlSAX2ExternalSubset |  
xmlSAX2ResolveEntity | xmlNoNetExternalEntityLoader |  
xmlNewInputFromFile | __xmlParserInputBufferCreateFilename |  
WebCore::openFunc(char const*) |  
WebCore 
::FrameLoader::loadResourceSynchronously(WebCore::ResourceRequest  
const&, WebCore::StoredCredentials, WebCore::ResourceError&,  
WebCore::ResourceResponse&, WTF::Vector<char, 0ul>&) |  
WebCore::FrameLoader::requestFromDelegate(WebCore::ResourceRequest&,  
unsigned long&, WebCore::ResourceError&) |  
WebCore 
::FrameLoader::dispatchAssignIdentifierToInitialRequest(unsigned long,  
WebCore::DocumentLoader*, WebCore::ResourceRequest const&) |  
WebFrameLoaderClient::assignIdentifierToInitialRequest(unsigned long,  
WebCore::DocumentLoader*, WebCore::ResourceRequest const&) |  
WebCore::ResourceRequest::nsURLRequest() const |  
WebCore::ResourceRequestBase::updatePlatformRequest() const |  
WebCore::ResourceRequest::doUpdatePlatformRequest() |  
WebCore::KURL::operator NSURL*() const | WebCore::KURL::createCFURL()  
const | CFURLCreateAbsoluteURLWithBytes | CFStringCreateWithBytes |  
__CFStringCreateImmutableFunnel3 | _CFRuntimeCreateInstance |  
malloc_zone_malloc


Thanks.



More information about the webkit-dev mailing list