Bug 48549

Summary: [Qt] refcount assertion on WebPageProxy, when closing a window
Product: WebKit Reporter: zalan <zalan>
Component: WebKit2Assignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: christian.webkit, commit-queue, darin, sam
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
remove extra adoptref
sam: review-
retain WKPageRef none

zalan
Reported 2010-10-28 12:19:09 PDT
ASSERTION FAILED: m_refCount > 0 (../../../qtwebkit-webkit2-dev/JavaScriptCore/wtf/RefCounted.h:83 bool WTF::RefCountedBase::derefBase()) occurs when closing a window. Apparently a ref is missing, when WebPageProxy is destroyed. I am still yet to check it out on Mac, but with Qt, it is easy to reproduce. It looks like, during the construction of a new page, we lose one ref in WebUIClient::createNewPage(), when we call adoptRef on the WebPageProxy object. I'm puzzled why this adoptRef is called (WebUIClient.cpp line#78), when we already call adoptRef on the object, when it is being created (WebPageProxy::create()). Looking at the 'new page' callback backtrace, I can't see where this extra (adopted) ref would come from. When adoptRef() is removed, refcount goes back to normal and no assert on window.close().
Attachments
remove extra adoptref (1.29 KB, patch)
2010-11-11 00:39 PST, zalan
sam: review-
retain WKPageRef (1.22 KB, patch)
2010-11-19 06:12 PST, zalan
no flags
zalan
Comment 1 2010-11-11 00:39:03 PST
Created attachment 73586 [details] remove extra adoptref
Sam Weinig
Comment 2 2010-11-11 16:04:51 PST
Comment on attachment 73586 [details] remove extra adoptref The implementation of createNewPage should return a retained WKPageRef, so the existing code is correct.
Darin Adler
Comment 3 2010-11-11 16:34:02 PST
This is probably a bug in the test program, not WebKit2 itself.
zalan
Comment 4 2010-11-11 23:56:20 PST
ok, thanks for the clarification.
zalan
Comment 5 2010-11-19 06:12:39 PST
Created attachment 74380 [details] retain WKPageRef
Andreas Kling
Comment 6 2010-11-19 15:00:58 PST
Comment on attachment 74380 [details] retain WKPageRef LGTM
WebKit Commit Bot
Comment 7 2010-11-19 22:26:28 PST
The commit-queue encountered the following flaky tests while processing attachment 74380 [details]: fast/profiler/throw-exception-from-eval.html Please file bugs against the tests. These tests were authored by kmccullough@apple.com, oliver@apple.com, and timothy@apple.com. The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 8 2010-11-19 22:29:23 PST
Comment on attachment 74380 [details] retain WKPageRef Clearing flags on attachment: 74380 Committed r72468: <http://trac.webkit.org/changeset/72468>
WebKit Commit Bot
Comment 9 2010-11-19 22:29:30 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.