Bug 48079 - [Qt] InspectorClientQt crashes when deleting a qwebpage which has an inspector
Summary: [Qt] InspectorClientQt crashes when deleting a qwebpage which has an inspector
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-21 10:54 PDT by Yi Shen
Modified: 2010-11-03 09:57 PDT (History)
3 users (show)

See Also:


Attachments
first try (1.90 KB, patch)
2010-10-21 10:59 PDT, Yi Shen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yi Shen 2010-10-21 10:54:43 PDT
Steps to reproduce this issue
1. Launch QtTestBrowser and load a website like 'webkit.org'
2. on the menu bar, choose 'Developer'->'Show Web Inspector'
3. on the menu bar, choose 'Developer'->'QGraphicsView'->'Toggle use of QGraphicsView'

Result, the QtTestBrowser crashes

Following is the calltrace,

#0  0x01e02d01 in WebCore::InspectorClientQt::sendMessageToFrontend (this=0x8242b50, message="{\"type\":\"event\",\"event\":\"disconnectFromBackend\",\"data\":{}}")
    at ../../../WebKit/qt/WebCoreSupport/InspectorClientQt.cpp:258
#1  0x01500051 in WebCore::InspectorFrontend::disconnectFromBackend (this=0x844c370) at generated/InspectorFrontend.cpp:142
#2  0x019d5062 in WebCore::InspectorController::inspectedPageDestroyed (this=0x8264068) at ../../../WebCore/inspector/InspectorController.cpp:184
#3  0x01b3e8e8 in ~Page (this=0x8242ef8, __in_chrg=<value optimized out>) at ../../../WebCore/page/Page.cpp:215
#4  0x01e23934 in ~QWebPagePrivate (this=0x8229c98, __in_chrg=<value optimized out>) at ../../../WebKit/qt/Api/qwebpage.cpp:333
#5  0x01e28304 in ~QWebPage (this=0x820b558, __in_chrg=<value optimized out>) at ../../../WebKit/qt/Api/qwebpage.cpp:1771
#6  0x0807a11c in ~WebPage (this=0x820b558, __in_chrg=<value optimized out>) at ../../../../WebKitTools/QtTestBrowser/webpage.h:39
#7  0x08072c6e in MainWindow::setPage (this=0xb7500a70, page=0x8427c58) at ../../../../WebKitTools/QtTestBrowser/mainwindow.cpp:106
#8  0x08066f5e in LauncherWindow::initializeView (this=0xb7500a70) at ../../../../Web
...
Comment 1 Yi Shen 2010-10-21 10:59:42 PDT
Created attachment 71460 [details]
first try
Comment 2 Yi Shen 2010-10-22 06:29:16 PDT
The problem is that m_inspectedWebPage->d->inspector is NULL in following snippet

bool InspectorClientQt::sendMessageToFrontend(const String& message)
{
    if (m_inspectedWebPage->d->inspector->d->remoteFrontend) { // crash
Comment 3 Yi Shen 2010-10-22 06:30:23 PDT
(In reply to comment #2)
> The problem is that m_inspectedWebPage->d->inspector is NULL in following snippet
> 
> bool InspectorClientQt::sendMessageToFrontend(const String& message)
> {
>     if (m_inspectedWebPage->d->inspector->d->remoteFrontend) { // crash

Sorry, m_inspectedWebPage->d->inspector->d is NULL
Comment 4 Andreas Kling 2010-10-22 07:58:43 PDT
Comment on attachment 71460 [details]
first try

LGTM.
Comment 5 WebKit Commit Bot 2010-10-22 08:34:56 PDT
The commit-queue encountered the following flaky tests while processing attachment 71460 [details]:

java/lc3/JSObject/ToObject-001.html

Please file bugs against the tests.  The author(s) of the test(s) are ap@webkit.org and ap@webkit.org.  The commit-queue is continuing to process your patch.
Comment 6 WebKit Commit Bot 2010-10-22 08:35:48 PDT
Comment on attachment 71460 [details]
first try

Clearing flags on attachment: 71460

Committed r70308: <http://trac.webkit.org/changeset/70308>
Comment 7 WebKit Commit Bot 2010-10-22 08:35:53 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Suresh Voruganti 2010-10-26 12:40:49 PDT
Yi, do we need this patch for Qtwebkit 2.1 branch?
Comment 9 Yi Shen 2010-10-26 12:46:13 PDT
(In reply to comment #8)
> Yi, do we need this patch for Qtwebkit 2.1 branch?

We'd better to have it. Thanks!
Comment 10 Suresh Voruganti 2010-11-02 10:28:06 PDT
Please cherry pick the fix for Qtwebkit 2.1 branch
Comment 11 Ademar Reis 2010-11-03 09:56:53 PDT
Revision r70308 cherry-picked into qtwebkit-2.1 with commit da8bfab <http://gitorious.org/webkit/qtwebkit/commit/da8bfab>