Bug 67051 - JSDOMWindowShell.cpp: ASSERT(!m_window || domWindow.get() != m_window->impl())
Summary: JSDOMWindowShell.cpp: ASSERT(!m_window || domWindow.get() != m_window->impl())
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-26 11:56 PDT by asvitkine
Modified: 2011-08-29 08:07 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.55 KB, patch)
2011-08-26 11:58 PDT, asvitkine
ap: review-
ap: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description asvitkine 2011-08-26 11:56:13 PDT
Fix assertion when running debug build of Mac platform DRT.
Comment 1 asvitkine 2011-08-26 11:58:29 PDT
Created attachment 105387 [details]
Patch
Comment 2 Darin Adler 2011-08-26 12:04:23 PDT
Comment on attachment 105387 [details]
Patch

It makes the assertion go away, but it is correct?
Comment 3 asvitkine 2011-08-26 12:08:34 PDT
The assertion checks that setWindow() is not called with the same window that's already set.

This patch makes the code not do that. I do not know the context of this code to tell you more.
Comment 4 Darin Adler 2011-08-26 12:09:03 PDT
(In reply to comment #3)
> I do not know the context of this code to tell you more.

Exactly. We need a reviewer who does.
Comment 5 Geoffrey Garen 2011-08-26 13:28:36 PDT
+Alexey, since he added the ASSERT.
Comment 6 Alexey Proskuryakov 2011-08-26 14:04:52 PDT
Comment on attachment 105387 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=105387&action=review

I'm confused. Is there something special that one needs to do to hit this assertion? Mac debug build is how I'm running DRT, and I haven't seen it fire.

> Source/WebCore/bindings/js/ScriptController.cpp:193
>          windowShell->window()->willRemoveFromWindowShell();
> -        windowShell->setWindow(m_frame->domWindow());
> +        if (m_frame->domWindow() != windowShell->impl())
> +            windowShell->setWindow(m_frame->domWindow());

This can not be quite correct, because we tell JSDOMWindow that it will be removed from window shell, but don't fulfill the promise.

I would need to see how the assertion fails (and then probably consult with Geoff) to suggest a better approach, but it's likely that we should avoid calling clearWindowShell altogether.
Comment 7 Alexey Proskuryakov 2011-08-26 14:06:42 PDT
> avoid calling clearWindowShell altogether

(in the case that makes the assertion fail).
Comment 8 asvitkine 2011-08-26 14:47:49 PDT
I encountered this invoking:

DumpRenderTree --pixel-tests /full/path/to/WebKit/LayoutTests/fast/repaint/background-scaling.html
Comment 9 Alexey Proskuryakov 2011-08-26 15:28:40 PDT
I cannot reproduce this. Could you please attach a stack trace?
Comment 10 asvitkine 2011-08-29 08:06:57 PDT
I've updated my checkout and rebuild and am no longer seeing this. Sorry for the noise.
Comment 11 asvitkine 2011-08-29 08:07:50 PDT
For the record, the original stack trace was:


ASSERTION FAILED: !m_window || domWindow.get() != m_window->impl() /WebKit/Source/WebCore/bindings/js/JSDOMWindowShell.cpp(62) : void WebCore::JSDOMWindowShell::setWindow(WTF::PassRefPtr<WebCore::DOMWindow>)
1   WebCore::JSDOMWindowShell::setWindow(WTF::PassRefPtr<WebCore::DOMWindow>)
2   WebCore::ScriptController::clearWindowShell(bool)
3   WebCore::Frame::pageDestroyed()
4   WebCore::FrameLoader::detachFromParent()
5   -[WebView(WebPrivate) _close]
6   -[WebView close]
7   testStringByEvaluatingJavaScriptFromString()
8   dumpRenderTree(int, char const**)
9   main
10  start