Bug 50892

Summary: [Qt][WK2] Crash in WebPage constructor
Product: WebKit Reporter: Balazs Kelemen <kbalazs>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ossy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
Patch none

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!