Bug 151532 - Fix crash in ~WebProcessPool when using Geolocation with useNetworkProcess=1
Summary: Fix crash in ~WebProcessPool when using Geolocation with useNetworkProcess=1
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-20 19:32 PST by Alex Christensen
Modified: 2015-11-23 10:39 PST (History)
0 users

See Also:


Attachments
Patch (7.37 KB, patch)
2015-11-20 19:38 PST, Alex Christensen
benjamin: review+
benjamin: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2015-11-20 19:32:40 PST
Fix crash in ~WebProcessPool when using Geolocation with useNetworkProcess=1
Comment 1 Alex Christensen 2015-11-20 19:38:39 PST
Created attachment 266026 [details]
Patch
Comment 2 Benjamin Poulain 2015-11-21 21:58:55 PST
Comment on attachment 266026 [details]
Patch

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

> Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp:66
> +    if (wasUpdating && !isUpdating())
> +        m_provider.stopUpdating(this);
> +    else {

Actually, you only need 
    ASSERT(!isUpdating());
    if (wasUpdating)
        m_provider.stopUpdating(this);

If isUpdating() is true, something really fucked up is going on.

It looks like the API contract does not require you to change the high accuracy settings if you stop the providers. Let's remove the else {} case.

> Tools/ChangeLog:14
> +        Properly load about:blank in all WebViews to clean up.

IMHO, it would be worth explaining why.
Can you add a paragraph explaining that we had a Geolocation provider stopping after its state tracker was destroyed with its stack frame?

> Tools/TestWebKitAPI/Tests/WebKit2/Geolocation.cpp:235
> +            EXPECT_EQ(GeolocationEvent::DisableHighAccuracy, events[3]);

We know these do not work. Can you find a way to make them work?

If not, maybe turn them into assertions?
Comment 3 Alex Christensen 2015-11-23 10:37:45 PST
(In reply to comment #2)
> Comment on attachment 266026 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=266026&action=review
> 
> > Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp:66
> > +    if (wasUpdating && !isUpdating())
> > +        m_provider.stopUpdating(this);
> > +    else {
> 
> Actually, you only need 
>     ASSERT(!isUpdating());
>     if (wasUpdating)
>         m_provider.stopUpdating(this);
> 
> If isUpdating() is true, something really fucked up is going on.
> 
> It looks like the API contract does not require you to change the high
> accuracy settings if you stop the providers. Let's remove the else {} case.
Done.
> 
> > Tools/ChangeLog:14
> > +        Properly load about:blank in all WebViews to clean up.
> 
> IMHO, it would be worth explaining why.
> Can you add a paragraph explaining that we had a Geolocation provider
> stopping after its state tracker was destroyed with its stack frame?
Done.
> 
> > Tools/TestWebKitAPI/Tests/WebKit2/Geolocation.cpp:235
> > +            EXPECT_EQ(GeolocationEvent::DisableHighAccuracy, events[3]);
> 
> We know these do not work. Can you find a way to make them work?
> 
> If not, maybe turn them into assertions?
These do not work if the process crashes, but they do work if the process does not crash.  I'm leaving them as they are.
Comment 4 Alex Christensen 2015-11-23 10:39:35 PST
http://trac.webkit.org/changeset/192747