Results 1 to 10 of 10

Thread: A crash in QGraphicsScenePrivate::draw()

  1. #1
    Join Date
    Sep 2012
    Location
    Kharkiv
    Posts
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default A crash in QGraphicsScenePrivate::draw()

    Did somebody encountered such kind of crash:
    Qt Code:
    1. Thread 1 (LWP 1380):
    2. #0 0x740b70c4 in raise () from /home/work/Projects/unistack/repository/unistack-output/pil_packages/p-broadcomnexus-bcm7428/staging_dir/lib/libc.so.0
    3. #1 0x740b0754 in abort () from /home/work/Projects/unistack/repository/unistack-output/pil_packages/p-broadcomnexus-bcm7428/staging_dir/lib/libc.so.0
    4. #2 0x742b9f8c in signal_handler () from /home/work/Projects/unistack/repository/unistack-output/pil_packages/p-broadcomnexus-bcm7428/staging_dir/usr/lib/libdirect-1.4.so.15
    5. #3 <signal handler called>
    6. #4 0x75db7edc in QGraphicsScenePrivate::draw(QGraphicsItem*, QPainter*, QTransform const*, QTransform const*, QRegion*, QWidget*, float, QTransform const*, bool, bool) ()
    7. #5 0x75db9db8 in QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem*, QPainter*, QTransform const*, QRegion*, QWidget*, float, QTransform const*) ()
    8. #6 0x75db7ed4 in QGraphicsScenePrivate::draw(QGraphicsItem*, QPainter*, QTransform const*, QTransform const*, QRegion*, QWidget*, float, QTransform const*, bool, bool) ()
    9. #7 0x75db9db8 in QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem*, QPainter*, QTransform const*, QRegion*, QWidget*, float, QTransform const*) ()
    10. #8 0x75db7ed4 in QGraphicsScenePrivate::draw(QGraphicsItem*, QPainter*, QTransform const*, QTransform const*, QRegion*, QWidget*, float, QTransform const*, bool, bool) ()
    11. #9 0x75db9db8 in QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem*, QPainter*, QTransform const*, QRegion*, QWidget*, float, QTransform const*) ()
    12. #10 0x75db7ed4 in QGraphicsScenePrivate::draw(QGraphicsItem*, QPainter*, QTransform const*, QTransform const*, QRegion*, QWidget*, float, QTransform const*, bool, bool) ()
    13. #11 0x75db9db8 in QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem*, QPainter*, QTransform const*, QRegion*, QWidget*, float, QTransform const*) ()
    14. #12 0x75db7ed4 in QGraphicsScenePrivate::draw(QGraphicsItem*, QPainter*, QTransform const*, QTransform const*, QRegion*, QWidget*, float, QTransform const*, bool, bool) ()
    15. #13 0x75db9db8 in QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem*, QPainter*, QTransform const*, QRegion*, QWidget*, float, QTransform const*) ()
    16. #14 0x75db7ed4 in QGraphicsScenePrivate::draw(QGraphicsItem*, QPainter*, QTransform const*, QTransform const*, QRegion*, QWidget*, float, QTransform const*, bool, bool) ()
    17. #15 0x75db9db8 in QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem*, QPainter*, QTransform const*, QRegion*, QWidget*, float, QTransform const*) ()
    18. #16 0x75db7ed4 in QGraphicsScenePrivate::draw(QGraphicsItem*, QPainter*, QTransform const*, QTransform const*, QRegion*, QWidget*, float, QTransform const*, bool, bool) ()
    19. #17 0x75db9db8 in QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem*, QPainter*, QTransform const*, QRegion*, QWidget*, float, QTransform const*) ()
    20. #18 0x75dba5e8 in QGraphicsScenePrivate::drawItems(QPainter*, QTransform const*, QRegion*, QWidget*) ()
    21. #19 0x75ddb8fc in QGraphicsView::paintEvent(QPaintEvent*) ()
    22. #20 0x7584f220 in QWidget::event(QEvent*) () from /home/work/Projects/unistack/repository/unistack-output/pil_packages/p-broadcomnexus-bcm7428/staging_dir/usr/lib/libQtGui.so.4
    23. #21 0x75bd0da8 in QFrame::event(QEvent*) () from /home/work/Projects/unistack/repository/unistack-output/pil_packages/p-broadcomnexus-bcm7428/staging_dir/usr/lib/libQtGui.so.4
    24. #22 0x75ddda24 in QGraphicsView::viewportEvent(QEvent*) ()
    To copy to clipboard, switch view to plain text mode 
    It seems the crash happens when webkit for some reason removes QGraphicsItem in GraphicsLayerQtImpl::~GraphicsLayerQtImpl() while this item is being drawn in QGraphicsScenePrivate::draw().

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: A crash in QGraphicsScenePrivate::draw()

    Show your code.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2012
    Location
    Kharkiv
    Posts
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: A crash in QGraphicsScenePrivate::draw()

    I'm just using QGraphicsWebView for rendering web content
    Qt Code:
    1. class WebView : public QGraphicsWebView
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. WebView *Application::newBrowserWindow()
    2. {
    3. WebView *browser = new WebView();
    4. browser->setGeometry( geometry );
    5. scene->addItem( browser );
    6. browser->show();
    7. return browser;
    8. }
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. WebView *view = newBrowserWindow();
    2. view->load( uri );
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: A crash in QGraphicsScenePrivate::draw()

    Is that the whole code needed to reproduce the problem?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Sep 2012
    Location
    Kharkiv
    Posts
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: A crash in QGraphicsScenePrivate::draw()

    No, but the main actions are in this code.
    The whole code is executed on embedded system and Qt draws using DirectFB plugin. So I believe it's hard to reproduce it on your side.

    Today I found out that the crash disappears when I disable QWebSettings::AcceleratedCompositingEnabled option.
    Before while digging in Qt code I notices that the place of code which caused the crash was under #if USE(ACCELERATED_COMPOSITING) define.
    It seems this option enables some sophisticated drawing algorithms with caching.

    I suppose this crash is some synchronization issue because it happens after some particular page is rendered n times (it may be 5th or 20th time).

    As I said previously I managed to find the situation after which crash happens.
    I added custom property to QGraphicsItem. I set it when the program enters QGraphicsScenePrivate::draw(QGraphicsItem *item, ...) and reset when the program leaves this method.
    I check this property in GraphicsLayerQtImpl::~GraphicsLayerQtImpl(). When the property is set (item is being drawn) the crash happens.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: A crash in QGraphicsScenePrivate::draw()

    What do you need this property for?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Sep 2012
    Location
    Kharkiv
    Posts
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: A crash in QGraphicsScenePrivate::draw()

    Only for testing. Just to detect the situation when the crash happens.
    Actually not a property but just custom data set by QGraphicsItem::setData(). it seemed to me a good approach.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: A crash in QGraphicsScenePrivate::draw()

    What you experience is not really a crash, you can see there is some UNIX signal emitted that causes libdirect to abort. I would assume your framebuffer implementation is incomplete and indeed some optimised code path causes it to malfunction.

    Or you are using threads incorrectly... Do you have multiple threads in your app?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Sep 2012
    Location
    Kharkiv
    Posts
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: A crash in QGraphicsScenePrivate::draw()

    Quote Originally Posted by wysota View Post
    What you experience is not really a crash, you can see there is some UNIX signal emitted that causes libdirect to abort.
    I called it a crash because the signal is SEGFAULT:
    Qt Code:
    1. (!) [ 1389: 1349881576.870] --> Caught signal 11 (at 0x40, invalid address) <--
    To copy to clipboard, switch view to plain text mode 
    Quote Originally Posted by wysota View Post
    I would assume your framebuffer implementation is incomplete and indeed some optimised code path causes it to malfunction.
    Yes, this seems to be true.
    Quote Originally Posted by wysota View Post
    Or you are using threads incorrectly... Do you have multiple threads in your app?
    In core dump I can see only a single browser thread... Nevertheless I will double check the code to be sure.
    Thanks for your hints.

  10. #10
    Join Date
    Sep 2012
    Location
    Kharkiv
    Posts
    17
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: A crash in QGraphicsScenePrivate::draw()

    Finally I came to the following solution (workaround):
    Qt Code:
    1. --- RenderLayer.cpp.org>2011-12-08 07:06:03.000000000 +0200
    2. +++ RenderLayer.cpp>2012-10-16 17:03:18.313964345 +0300
    3. @@ -3874,7 +3874,7 @@
    4. #if USE(ACCELERATED_COMPOSITING)
    5. if (compositor()->inCompositingMode()) {
    6. if ((isStackingContext() && m_zOrderListsDirty) || m_normalFlowListDirty)
    7. - compositor()->updateCompositingLayers(CompositingUpdateOnPaitingOrHitTest, this);
    8. +// compositor()->updateCompositingLayers(CompositingUpdateOnPaitingOrHitTest, this);
    9. return;
    10. }
    11. #endif
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 10
    Last Post: 10th February 2011, 23:31
  2. Crash gracefully? No crash!
    By lni in forum Qt Programming
    Replies: 0
    Last Post: 7th July 2010, 03:59
  3. Qwt crash in Vista
    By roland8454 in forum Qwt
    Replies: 3
    Last Post: 3rd February 2009, 19:53
  4. Crash detection
    By ^NyAw^ in forum Qt Programming
    Replies: 4
    Last Post: 23rd December 2008, 12:09
  5. qDevelop crash
    By babu198649 in forum Qt-based Software
    Replies: 7
    Last Post: 2nd February 2008, 05:34

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.