Bug 83567 - [BlackBerry] Crash when tearing down web page rendered using WebPageCompositor
Summary: [BlackBerry] Crash when tearing down web page rendered using WebPageCompositor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-10 05:32 PDT by Arvid Nilsson
Modified: 2012-04-10 12:55 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.47 KB, patch)
2012-04-10 05:37 PDT, Arvid Nilsson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Nilsson 2012-04-10 05:32:44 PDT
This happens when the WebPage::setVisible(false) is called as part of tearing down a WebPage. This calls suspendRootLayerCommit() which schedules destroyLayerResources() on the UI thread. UI thread call stack:

WebCore::LayerRenderer::releaseLayerResources (this=0x0)
    at /home/anilsson/dev/webkit/Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp:191
191	    if (m_hardwareCompositing) {
(gdb) p this
$1 = (WebCore::LayerRenderer * const) 0x0
(gdb) bt
#0  WebCore::LayerRenderer::releaseLayerResources (this=0x0)
    at /home/anilsson/dev/webkit/Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp:191
#1  0x7925dc2c in BlackBerry::WebKit::WebPageCompositorPrivate::releaseLayerResources (this=<optimized out>)
    at /home/anilsson/dev/webkit/Source/WebKit/blackberry/Api/WebPageCompositor.cpp:146
#2  0x7924c726 in BlackBerry::WebKit::WebPagePrivate::destroyLayerResources (
    this=<optimized out>)
    at /home/anilsson/dev/webkit/Source/WebKit/blackberry/Api/WebPage.cpp:5566
#3  0x7925c3aa in BlackBerry::Platform::MethodDelegate0<void (BlackBerry::WebKit::WebPagePrivate::*)(), BlackBerry::WebKit::WebPagePrivate>::execute (
    this=0xb7e980)
    at /home/anilsson/dev/staging/usr/include/browser/platform/BlackBerryPlatformMessageDelegate.h:770
#4  0x7a05ff98 in BlackBerry::Platform::ExecutableMessage::execute (
    this=<optimized out>)
    at /home/anilsson/dev/platform/blackberryplatform/BlackBerryPlatformExecutableMessage.cpp:38
...
Comment 1 Arvid Nilsson 2012-04-10 05:37:10 PDT
Created attachment 136435 [details]
Patch
Comment 2 Antonio Gomes 2012-04-10 05:54:40 PDT
Comment on attachment 136435 [details]
Patch

so if the mlayerRenderer is null, "resources" were already released?
Comment 3 Arvid Nilsson 2012-04-10 06:02:45 PDT
(In reply to comment #2)
> (From update of attachment 136435 [details])
> so if the mlayerRenderer is null, "resources" were already released?

Yes, or you could see it this way - the LayerRenderer owns the resources that should be released, so if there's no LayerRenderer, there are no resources to delete. Resources = textures right now, but could be more stuff in the future (for example shaders).
Comment 4 Antonio Gomes 2012-04-10 07:17:44 PDT
Comment on attachment 136435 [details]
Patch

(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 136435 [details] [details])
> > so if the mlayerRenderer is null, "resources" were already released?
> 
> Yes, or you could see it this way - the LayerRenderer owns the resources that should be released, so if there's no LayerRenderer, there are no resources to delete. Resources = textures right now, but could be more stuff in the future (for example shaders).

Ok. I was wondering was would be the codepath be...
Comment 5 Arvid Nilsson 2012-04-10 12:39:54 PDT
(In reply to comment #4)
> (From update of attachment 136435 [details])
> (In reply to comment #3)
> > (In reply to comment #2)
> > > (From update of attachment 136435 [details] [details] [details])
> > > so if the mlayerRenderer is null, "resources" were already released?
> > 
> > Yes, or you could see it this way - the LayerRenderer owns the resources that should be released, so if there's no LayerRenderer, there are no resources to delete. Resources = textures right now, but could be more stuff in the future (for example shaders).
> 
> Ok. I was wondering was would be the codepath be...

Right now, it's probably due to an earlier call to WebPageCompositor::cleanup() that would clear the layer renderer. The layer rendrrer destructor then releases the resources.
Comment 6 WebKit Review Bot 2012-04-10 12:55:34 PDT
Comment on attachment 136435 [details]
Patch

Clearing flags on attachment: 136435

Committed r113757: <http://trac.webkit.org/changeset/113757>
Comment 7 WebKit Review Bot 2012-04-10 12:55:39 PDT
All reviewed patches have been landed.  Closing bug.