Bug 10838

Summary: REGRESSION: Leaking of WebScriptObjectPrivate
Product: WebKit Reporter: Mark Rowe (bdash) <mrowe>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: slewis
Priority: P2 Keywords: Regression
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Patch aroben: review+

Description Mark Rowe (bdash) 2006-09-13 06:30:42 PDT
`run-webkit-tests --leaks` generates leak reports that have dozens of WebScriptObjectPrivate's being leaked.   An example of the backtrace is:

	Call stack: [thread 2d63a7]: | 0x0 | start | _start | main | runTest | -[NSRunLoop runMode:beforeDate:] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoSources0 | _sendCallbacks | -[NSURLConnection(NSURLConnectionInternal) _sendCallbacks] | -[NSURLConnection(NSURLConnectionInternal) _sendDidReceiveDataCallback] | -[WebLoader connection:didReceiveData:lengthReceived:] | -[WebMainResourceLoader didReceiveData:lengthReceived:allAtOnce:] | -[WebLoader didReceiveData:lengthReceived:allAtOnce:] | -[WebMainResourceLoader addData:allAtOnce:] | -[WebFrameLoader _receivedData:] | -[WebDataSource(WebInternal) _receivedData:] | -[WebDataSource(WebFileInternal) _commitLoadWithData:] | -[WebHTMLRepresentation receivedData:withDataSource:] | -[WebFrameBridge receivedData:textEncodingName:] | -[WebCoreFrameBridge setEncoding:userChosen:] | WebCore::Frame::setEncoding(WebCore::String const&, bool) | WebCore::Frame::receivedFirstData() | WebCore::Frame::begin(WebCore::KURL const&) | WebCore::FrameMac::partClearedInBegin() | -[WebFrameBridge windowObjectCleared] | -[WebCoreFrameBridge windowScriptObject] | WebCore::FrameMac::windowScriptObject() | -[WebScriptObject _initWithJSObject:originExecutionContext:executionContext:] | NSAllocateObject | _internal_class_createInstanceFromZone 
Leak: 0x1f89dce0  size=32	instance of 'WebScriptObjectPrivate'	
See http://build.webkit.org/results/post-commit-leaks-powerpc-mac-os-x/2531/DumpRenderTree5-leaks.txt for more examples.
Comment 1 Mark Rowe (bdash) 2006-09-14 18:03:49 PDT
The WebScriptObject's and co are expected to be cleaned up from FrameMac::cleanupPluginObjects, but this is never being called.  It is intended to be called from Frame::clear but as cleanupPluginObjects is a virtual method being called from the Frame destructor, the FrameMac subclass portion of the object has already been torn down.
Comment 2 Mark Rowe (bdash) 2006-09-14 20:21:22 PDT
Created attachment 10567 [details]
Patch
Comment 3 Adam Roben (:aroben) 2006-09-14 20:38:11 PDT
Comment on attachment 10567 [details]
Patch

r=me, although you've got a typo in your ChangeLog: "this its" should be "its"
Comment 4 Adam Roben (:aroben) 2006-09-14 20:42:42 PDT
Comment on attachment 10567 [details]
Patch

Stephanie is going to confirm that this patch helps fix some of our current performance regression, and then give you permission to check in if it does (since the tree is currently closed).
Comment 5 Mark Rowe (bdash) 2006-09-14 23:02:51 PDT
Stephanie gave the go-ahead via IRC, and this was landed as r16368.
Comment 6 Timothy Hatcher 2006-10-02 10:50:29 PDT
This landed in r16368.