Bug 104504 - [BlackBerry] Webkit crashes sometimes (even though very rarely) when deleting a webview
Summary: [BlackBerry] Webkit crashes sometimes (even though very rarely) when deleting...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Major
Assignee: Charles Wei
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-09 20:05 PST by Charles Wei
Modified: 2012-12-10 05:35 PST (History)
8 users (show)

See Also:


Attachments
Patch (2.92 KB, patch)
2012-12-09 20:11 PST, Charles Wei
no flags Details | Formatted Diff | Diff
Patch (3.06 KB, patch)
2012-12-09 23:09 PST, Charles Wei
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Wei 2012-12-09 20:05:51 PST
Internal tracking number: 261567
        
When deleting a webview, the webkit thread will send a sync message to userInterfaceThread to delete handlers, including the viewport accessor. But the UserInterfaceThread could be doing a blit after it has deleted the viewport accessor and before the webkit thread gets the time slot to resume it's operation to clean up the webview, which leaves a very short time that viewport accessor of a webpage has been deleted while the webpage is still in   the process of deleting, and the viewport accessor is referenced in the UserInterfaceThread when blitting contents.
    
So we need to check if the viewport accessor is NULL before using it in the BackingStore code.
Comment 1 Charles Wei 2012-12-09 20:11:02 PST
Created attachment 178461 [details]
Patch
Comment 2 Charles Wei 2012-12-09 20:12:05 PST
Comment on attachment 178461 [details]
Patch

Already reviewed and approved by George Staikos offline. Commit it.
Comment 3 Arvid Nilsson 2012-12-09 21:25:24 PST
This patch is not quite right, see comment in PR #261257
Comment 4 Arvid Nilsson 2012-12-09 21:25:42 PST
(In reply to comment #3)
> This patch is not quite right, see comment in PR #261257

Uh, 261567
Comment 5 Charles Wei 2012-12-09 21:27:22 PST
Ok, stopped committing. will fix .
Comment 6 Charles Wei 2012-12-09 23:09:22 PST
Created attachment 178478 [details]
Patch
Comment 7 Charles Wei 2012-12-09 23:23:00 PST
With the internal bug fix for 261671,  this seems less likely to happen. But it doesn't hurt to have this fix just in case there's other code path that might reach here.
Comment 8 Arvid Nilsson 2012-12-10 04:51:45 PST
(In reply to comment #7)
> With the internal bug fix for 261671,  this seems less likely to happen. But it doesn't hurt to have this fix just in case there's other code path that might reach here.

I agree, checking for null when something can be null is good.
Comment 9 Rob Buis 2012-12-10 05:01:40 PST
Comment on attachment 178478 [details]
Patch

LGTM.
Comment 10 Charles Wei 2012-12-10 05:26:14 PST
Comment on attachment 178478 [details]
Patch

Commit.
Comment 11 WebKit Review Bot 2012-12-10 05:35:43 PST
Comment on attachment 178478 [details]
Patch

Clearing flags on attachment: 178478

Committed r137140: <http://trac.webkit.org/changeset/137140>
Comment 12 WebKit Review Bot 2012-12-10 05:35:47 PST
All reviewed patches have been landed.  Closing bug.