×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    42

    QML WebView crashes after user goes to Task Switcher

    I have reported similar problem before but have never figured out a solution for it. Hopefully I will have better luck this time - I have two applications waiting for a workaround so I can release them to the Harmattan platform.

    The application will crash with segfault if the javascript tries to update the screen when (or after) the user switches to the task switcher on harmattan. This is the output:
    Code:
    Meego graphics system destroyed
    QPaintDevice: Cannot destroy paint device that is being painted
    Segmentation fault
    Finished running remote process. Exit code was 139.
    I have now a very simple example that reproduce the issue 100% of the time.
    I can't report this to the harmattan bug web site anymore so I am posting to any and all channels where I may find someone with expertise to help me.

    In order to avoid a long e-mail with attached files I created a simple web page with more information: http://crochik.com/webview/

    Thanks in advance,
    Felipe

  2. #2
    Nokia Developer Expert
    Join Date
    Oct 2007
    Posts
    441

    Re: QML WebView crashes after user goes to Task Switcher

    Hi

    just out of curiosity i have checked your test app on Symbian. It is broken also. And the main point i think is QML misuse -- well it might be a bug , but -- why don't you create typical hybrid application based on QWebView -- rather standard approach?

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    42

    Re: QML WebView crashes after user goes to Task Switcher

    The application works fine on Symbian. The issue is not with the QML Component is actually with WebKit in general - I have the same issue with another application that does not use the QML component at all - this is just the simplest example I could come up with to reproduce the issue.

    More important I can only reproduce the issue if I go to the task switcher on Harmattan. If you just push the power button (the application will be deactivated as well) to have the phone "lock the screen" and then double click the screen to unlock the phone, the application will continue to run just fine.

    It seems that the "task switcher" hijacks/invalidates the paint device that was available to the webkit without "letting it know" and when the javascript tries to reuse it the application crashes.

    Quote Originally Posted by izinin View Post
    Hi

    just out of curiosity i have checked your test app on Symbian. It is broken also. And the main point i think is QML misuse -- well it might be a bug , but -- why don't you create typical hybrid application based on QWebView -- rather standard approach?

  4. #4
    Registered User
    Join Date
    Jun 2009
    Posts
    42

    Re: QML WebView crashes after user goes to Task Switcher

    Wait... I didn't notice that you tested the application on symbian... I misread and thought you were asking me (sorry!).... I haven't tested this application but I have another one that crashes on Harmattan with the exact same symptoms but works just fine on Symbian (http://store.ovi.com/content/214406)
    What do you do to make it crash on Symbian?

    BTW, how is this misuse? If it can't open a simple html page with javascript without crashing is not of much use, is it?

    Quote Originally Posted by izinin View Post
    Hi

    just out of curiosity i have checked your test app on Symbian. It is broken also. And the main point i think is QML misuse -- well it might be a bug , but -- why don't you create typical hybrid application based on QWebView -- rather standard approach?

  5. #5
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: QML WebView crashes after user goes to Task Switcher

    Hi,
    I didn't test your app yet on my N9, but I noticed that the html file you load in the webview works nicely on grob.
    Grob makes use of the webkit used by any other Qt app on the device.
    If grob doesn't crash and your app crash, the problem is elsewhere.
    GDB is for sure able to detect the problem.

  6. #6
    Registered User
    Join Date
    Jun 2009
    Posts
    42

    Re: QML WebView crashes after user goes to Task Switcher

    Hi gnuton (long time no "seeing" )

    The application does not have ANYTHING in special, it is 100% code generated by the (qt creator) "New QML Application" wizard. Maybe that is the problem!
    I have already tested several things: using the qml webview component (attached project/source code) and creating my own qml component - all them fail the same way: on or after the user switch to the task manager the application will segfault. That is the only scenario where it happens.

    When you tried the page on grob did you try going to the task manager ?
    Where is the grob application/source code available? I would love to investigate further... I have two applications that I can't release because of this and I can't find a fix.

    Thanks,
    Felipe

    Quote Originally Posted by gnuton View Post
    Hi,
    I didn't test your app yet on my N9, but I noticed that the html file you load in the webview works nicely on grob.
    Grob makes use of the webkit used by any other Qt app on the device.
    If grob doesn't crash and your app crash, the problem is elsewhere.
    GDB is for sure able to detect the problem.

  7. #7
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: QML WebView crashes after user goes to Task Switcher

    Hi Felipe,
    It's nice to "see" you again.
    Unfortunately Grob source code is not publicly available.

    I guess it doesn't crash because it doesn't make use of webkit 2.0 (shipped with Qt 4.7) but it makes use of webkit2, which is a completely different kind of animal with a different API too.

    moreover it support suspend() which is used when the window goes in background.
    http://gitorious.org/webkit/qtwebkit...aphicswkview.h

    As grob, you could use webkit2 too in your app. You can build and link the lib against your app.
    webkit2 can be used at same time with webkit.
    Last edited by gnuton; 2012-04-04 at 15:23.

  8. #8
    Registered User
    Join Date
    Jun 2009
    Posts
    42

    Re: QML WebView crashes after user goes to Task Switcher

    Now we are talking... kind of.... Is WebKit2 in version 2.2 of libqtwebkit?
    It seems that with PR1.2 the webkit on the device is now 2.2 but I haven't figured out how to update my scratchbox environment with it:

    version on device:
    Code:
    /home/developer $ dpkg -l libqtwebkit4
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name           Version        Description
    +++-==============-==============-============================================
    ii  libqtwebkit4   2.2.0~git20110 Web content engine library for Qt
    I haven't found instructions anywhere on how to build WebKit2.2 for harmattan. The instructions I found are for Qt5. On the webkit.org it says that to build webkit on linux 4.8 is required and to build Webkit2 Qt5 is required.

    Can you give me any hints on how to build my own webkit2 version for harmattan or, in case libqtwebkit4 version 2.2 really means webkit2, how to get the developer version of the package already on the device so I can build with it?

    Thanks in advance.
    Felipe
    Quote Originally Posted by gnuton View Post
    As grob, you could use webkit2 too in your app. You can build and link the lib against your app.
    webkit2 can be used at same time with webkit.

  9. #9
    Registered User
    Join Date
    Jul 2012
    Posts
    1

    Re: QML WebView crashes after user goes to Task Switcher

    Felipe,

    I'm having intermittent issues in an N9 application I'm developing also. I am also using a WebView element, but hadn't thought that would be the cause of the segfault and Exit code 139 until I saw your posts. Did you find a solution to the problem?

    thanks,
    Jeremy

  10. #10
    Registered User
    Join Date
    Jun 2009
    Posts
    42

    Re: QML WebView crashes after user goes to Task Switcher

    Jeremy,
    The segfault in my case was clearly related to going to the "task switcher" - it would crash after switching to it or just after going back to the application from it.
    Some of the problems I resolved with:
    Code:
        m_viewer.setViewport(new QGLWidget);
        m_viewer.setAttribute(Qt::WA_OpaquePaintEvent);
        m_viewer.setAttribute(Qt::WA_NoSystemBackground);
    In the case of my application I ended up also distributing an older version of the webkit because I found a regression with PR1.2. I haven't checked the status after PR1.3.

    p.s. I created my custom WebKit qml component but shouldn't make any difference in this case

  11. #11
    Nokia Developer Expert
    Join Date
    Oct 2007
    Posts
    441

    Re: QML WebView crashes after user goes to Task Switcher

    Hi Felipe,

    Do you handle lose application focus event in your app? If you do so in what particular way? You mentioned if you hide your app with lock button , it works fine after activation.

    Code:
        Connections{
            target: Qt.application
            onActiveChanged: {
    // TODO ..........
            }
        }
    Regards,
    Igor

Similar Threads

  1. QML Webview User Agent
    By Siddharth5 in forum [Archived] Qt Quick
    Replies: 5
    Last Post: 2012-07-09, 07:35
  2. How to make Task Switcher?
    By pavanputhra in forum Nokia N9
    Replies: 2
    Last Post: 2010-10-11, 15:03
  3. Icon doesn't change on task switcher
    By yuenfatt in forum Symbian
    Replies: 7
    Last Post: 2008-11-20, 07:11
  4. Removing icon from Task Switcher in S60
    By symsta in forum Symbian
    Replies: 8
    Last Post: 2008-09-22, 07:38
  5. Replies: 0
    Last Post: 2004-01-08, 08:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×