Results 1 to 4 of 4

Thread: How to avoid qtwebengine to crash main program?

  1. #1

    Default How to avoid qtwebengine to crash main program?

    I load many urls in a QWebEngineView object, one by one. Some urls are displayed normally, some will make my app crash. I do not know if it is a Qt problem or chromium problem. But can I avoid qtwebengine to crash main program so I can continue to load the following urls? It should be something like:
    Qt Code:
    1. for(i=0;i<100;i++)
    2. {
    3. try
    4. {
    5. view->load(urls[i]);
    6. }
    7. catch(...)
    8. {
    9. }
    10. }
    To copy to clipboard, switch view to plain text mode 
    But since QWebEngineView::load is an asynchronous function, I could not use the above code to ignore the failed url.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to avoid qtwebengine to crash main program?

    Quote Originally Posted by qtcentre2019 View Post
    Some urls are displayed normally, some will make my app crash.
    Do you have an example?

    Quote Originally Posted by qtcentre2019 View Post
    But since QWebEngineView::load is an asynchronous function
    Even if it were synchronous you would only be seeing the last URL.

    And a crash is not necessarily caused by an uncaught exception, a crash can be triggered by a lot of things.

    Cheers,
    _

  3. #3

    Default Re: How to avoid qtwebengine to crash main program?

    @anda_skoa
    Yes, there may be many reasons for the crash so I do not plan to dig the actual reason out. I just want to bypass the failed url and go to the next url. It seems all chromium stuff are run in QtWebEngineProcess.exe? If so, why the bug in chromium does not only crash QtWebEngineProcess.exe, but main program? If the crash is not caused by an exception, can I ignore the error and continue the execution of main program like what's done by try..catch? I really do not want to head into the QtWebEngine code to sort it out.

    Quote Originally Posted by anda_skoa View Post
    Do you have an example?


    Even if it were synchronous you would only be seeing the last URL.

    And a crash is not necessarily caused by an uncaught exception, a crash can be triggered by a lot of things.

    Cheers,
    _

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to avoid qtwebengine to crash main program?

    Quote Originally Posted by qtcentre2019 View Post
    It seems all chromium stuff are run in QtWebEngineProcess.exe?
    Yes

    Quote Originally Posted by qtcentre2019 View Post
    If so, why the bug in chromium does not only crash QtWebEngineProcess.exe, but main program?
    Have you determined that it is a bug in chromium?
    I.e. does the stack trace of the crash end in Chromium code?

    Quote Originally Posted by qtcentre2019 View Post
    If the crash is not caused by an exception, can I ignore the error and continue the execution of main program like what's done by try..catch?
    A crash means the process reached an unrecoverable state.
    The operating system has no other means than to end it.

    If a crash can not be fixed you can only isolate it, i.e. running the crashing code in a separate process.

    And just to be sure: you need to display all these pages, right?

    I.e. the reason you are not using QNetworkAccessManager is because you need the web content rendered on screen, correct?

    Cheers,
    _

Similar Threads

  1. [Qtwebengine] Running Chrome Apps in QtWebEngine
    By raunvivek in forum General Discussion
    Replies: 0
    Last Post: 9th July 2015, 14:32
  2. Replies: 4
    Last Post: 2nd April 2013, 10:38
  3. Avoid the qt_flush on my main widget
    By kinju in forum Qt Programming
    Replies: 0
    Last Post: 28th September 2010, 14:15
  4. how to avoid crash of my application......
    By newb in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2010, 11:09
  5. Replies: 0
    Last Post: 20th August 2010, 14:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.