Bug 26846 - trap in WebCore::SecurityOrigin::canAccess when inspecting the inspector
Summary: trap in WebCore::SecurityOrigin::canAccess when inspecting the inspector
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-30 10:22 PDT by Patrick Mueller
Modified: 2009-09-11 19:53 PDT (History)
1 user (show)

See Also:


Attachments
stack trace (10.99 KB, text/plain)
2009-06-30 10:23 PDT, Patrick Mueller
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Mueller 2009-06-30 10:22:14 PDT
I've been getting these traps all day, almost immediately, with r45357.  Scenario is debugging the web inspector.  Bring up a web app to debug in WebKit, enter Web Inspector.  Select file from file list, set a breakpoint.  Now get a context menu somewhere in the inspector window and click "inspect element", which will launch a new inspector, this time with the Web Inspector code itself.  Set a breakpoint somewhere in that inspector.  Now switch back to the original inspector, select a different source file - kaboom.

Inspecting the inspector is something I've done often over the last two months or so, generally there isn't any problem doing this.

Will attach a stack trace.
Comment 1 Patrick Mueller 2009-06-30 10:23:12 PDT
Created attachment 32077 [details]
stack trace
Comment 2 Patrick Mueller 2009-07-02 06:45:11 PDT
Same bug / stack trace occurring in nightly r45463
Comment 3 Patrick Mueller 2009-07-07 12:29:24 PDT
Still occurring on nightly r45585.

Brought up XCode to see if anything was obviously wrong.  But I'm lost, wandering in a sea of C++ wonderfulness.  :-)

Here's where things appear to be breaking down.

On the stack, I'm in JSDOMWindowCustom.h, in JSDOMWindowBase::allowAccessFromPrivate, which looks like this:

----
ALWAYS_INLINE bool JSDOMWindowBase::allowsAccessFromPrivate(const JSGlobalObject* other) const
{
    const JSDOMWindow* originWindow = asJSDOMWindow(other);
    const JSDOMWindow* targetWindow = d()->shell->window();

    if (originWindow == targetWindow)
        return true;

    const SecurityOrigin* originSecurityOrigin = originWindow->impl()->securityOrigin();
    const SecurityOrigin* targetSecurityOrigin = targetWindow->impl()->securityOrigin();

    return originSecurityOrigin->canAccess(targetSecurityOrigin);
}
----

When the return statement is processed, originSecurityOrigin is null.  Can't really decipher the origin/targetWindows to tell what's going on.  

An obvious tidbit after perusing the source is that ScriptFunctionCall on the stack at 10 appears to be calling a function "inspectedWindowCleared".
Comment 4 Patrick Mueller 2009-09-10 13:03:57 PDT
As of a nightly build this week, I can now sucessfully use Web Inspector on itself, which was the primary symptom for this bug.  

Feel free to close/resolve.