Bug 50892 - [Qt][WK2] Crash in WebPage constructor
Summary: [Qt][WK2] Crash in WebPage constructor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-12 06:42 PST by Balazs Kelemen
Modified: 2010-12-13 05:52 PST (History)
1 user (show)

See Also:


Attachments
Patch (1.81 KB, patch)
2010-12-12 06:52 PST, Balazs Kelemen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Balazs Kelemen 2010-12-12 06:42:23 PST
WebPage initializing it's Page with a PageClients with zero DeviceMotionClient* that leads to 
zero pointer dereference. This is how Page using the clients:
#if ENABLE(DEVICE_ORIENTATION)
    , m_deviceMotionController(RuntimeEnabledFeatures::deviceMotionEnabled() ? new DeviceMotionController(pageClients.deviceMotionClient) : 0)
    , m_deviceOrientationController(RuntimeEnabledFeatures::deviceOrientationEnabled() ? new DeviceOrientationController(this, pageClients.deviceOrientationClient) : 0)
#endif

That means the correct fix is to disable the device motion and orientation features at runtime. The WebPage contructor also needs a fix for consistency with the enable flags but that should be done in a different patch.
Comment 1 Balazs Kelemen 2010-12-12 06:52:34 PST
Created attachment 76326 [details]
Patch
Comment 2 Andreas Kling 2010-12-12 07:13:45 PST
Comment on attachment 76326 [details]
Patch

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

LGTM, except one small and one big thing:

> WebKit2/WebProcess/qt/WebProcessQt.cpp:47
> +    // Disable runtime enabled features that has no WebKit2 implementation yet.

s/has/have/

> WebKit2/WebProcess/qt/WebProcessQt.cpp:53
> +    WebCore::RntimeEnabledFeatures::setSpeechInputEnabled(false);

s/Rntime/Runtime/
Comment 3 Balazs Kelemen 2010-12-12 08:26:46 PST
Committed in http://trac.webkit.org/changeset/73876.
Comment 4 Csaba Osztrogonác 2010-12-13 05:28:34 PST
(In reply to comment #3)
> Committed in http://trac.webkit.org/changeset/73876.

Thx for the fix.
Comment 5 Balazs Kelemen 2010-12-13 05:52:49 PST
(In reply to comment #4)
> (In reply to comment #3)
> > Committed in http://trac.webkit.org/changeset/73876.
> 
> Thx for the fix.

It's an honor to serve you!