Summary: | Random(?) crashes deep in Qt painting codee | ||
---|---|---|---|
Product: | [Unmaintained] kmail | Reporter: | Thomas McGuire <mcguire> |
Component: | new message list | Assignee: | Szymon Stefanek <pragma> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | amantia, bitsed, cuciferus, djarvie, infobox.oleg, manolis, mcguire, popmar, pragma, viesturs.zarins |
Priority: | VHI | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Thomas McGuire
2008-11-02 01:40:07 UTC
ACK: This procedure works reliably also for me. A guess is that the shared painter is a mismatch in begin()/end() calls for the shared painter... Sometimes I also get a SIGSEGV instead of a Q_ASSERT(). ... QPaintEngine::setSystemClip: Should not be changed while engine is active QPaintEngine::setSystemClip: Should not be changed while engine is active QWidgetPrivate::beginSharedPainter: Painter is already active Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7f53fd5306f0 (LWP 9710)] 0x00007f53fc15d98c in QPaintEngine::isActive (this=0x91) at ../../include/QtGui/../../src/gui/painting/qpaintengine.h:148 148 bool isActive() const { return active; } bt #0 0x00007f53fc15d98c in QPaintEngine::isActive (this=0x91) at ../../include/QtGui/../../src/gui/painting/qpaintengine.h:148 #1 0x00007f53fc1dce03 in QPainter::isActive (this=0xc83160) at painting/qpainter.cpp:1420 #2 0x00007f53fc11e2df in QWidgetPrivate::drawWidget (this=0x97d340, pdev=0x7e54d8, rgn=@0x7fff05573140, offset=@0x7fff05573100, flags=4, sharedPainter=0xc83160) at kernel/qwidget.cpp:4565 #3 0x00007f53fc11f262 in QWidgetPrivate::paintSiblingsRecursive (this=0x915ca0, pdev=0x7e54d8, siblings=@0x7fff05573310, index=2, rgn=@0x7fff055734e0, offset=@0x7fff055734a0, flags=4, sharedPainter=0xc83160) at kernel/qwidget.cpp:4735 ... I have also tested the QT_NO_SHARED_PAINTER env variable. Setting it to 1 disables the shared painter code and makes the bug vanish (as expected). (...so actually you have a temporary hack if the bug is hitting you in production environment). Hm.. I guess that I need to get some rest as I've written the opposite of what I wanted :D Sometimes I also get a Q_ASSERT instead of a SIGSEGV (with the same procedure). QWidgetPrivate::beginSharedPainter: Painter is already active ASSERT: "sharedPainter ? sharedPainter->isActive() : true" in file kernel/qwidget.cpp, line 4605 Program received signal SIGABRT, Aborted. [Switching to Thread 0x2b6c4fa2bc50 (LWP 10214)] 0x00002b6c43e2b589 in raise () from /lib/libc.so.6 (gdb) bt #0 0x00002b6c43e2b589 in raise () from /lib/libc.so.6 #1 0x00002b6c43e2ca5e in abort () from /lib/libc.so.6 #2 0x00002b6c42336481 in qt_message_output (msgType=QtFatalMsg, buf=0x18ac9f8 "ASSERT: \"sharedPainter ? sharedPainter->isActive() : true\" in file kernel/qwidget.cpp, line 4605") at global/qglobal.cpp:2108 #3 0x00002b6c42336f7e in qFatal (msg=0x2b6c424a7e78 "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2291 #4 0x00002b6c4233608f in qt_assert (assertion=0x2b6c414457c0 "sharedPainter ? sharedPainter->isActive() : true", file=0x2b6c41445243 "kernel/qwidget.cpp", line=4605) at global/qglobal.cpp:1879 #5 0x00002b6c40deff43 in QWidgetPrivate::drawWidget (this=0xe79f30, pdev=0x6983d8, rgn=@0x7fff6aaab820, offset=@0x7fff6aaab7f0, flags=68, sharedPainter=0x13456c0, backingStore=0x889a40) at kernel/qwidget.cpp:4605 #6 0x00002b6c40f8d04a in QWidgetBackingStore::sync (this=0x889a40) at painting/qbackingstore.cpp:972 #7 0x00002b6c40de9793 in QWidgetPrivate::syncBackingStore (this=0xd467c0) at kernel/qwidget.cpp:1545 It looks that endSharedPainter() is called too early QWidgetPrivate::beginSharedPainter(this=7e17c0,q=7e4a20,tlw=7e4a20,tlwExtra=7e3560,tlwExtra->sharedPainter=0) >> QWidgetPrivate::drawWidget(this=7e17c0,sharedPainter=c3def0,sRecursionCount=0) >> QWidgetPrivate::drawWidget(this=7e7960,sharedPainter=c3def0,sRecursionCount=1) >> QWidgetPrivate::drawWidget(this=afd870,sharedPainter=c3def0,sRecursionCount=2) >> QWidgetPrivate::drawWidget(this=afda90,sharedPainter=c3def0,sRecursionCount=3) >> QWidgetPrivate::drawWidget(this=7e85c0,sharedPainter=c3def0,sRecursionCount=4) >> QWidgetPrivate::drawWidget(this=7e8850,sharedPainter=c3def0,sRecursionCount=5) >> QWidgetPrivate::drawWidget(this=7ec0c0,sharedPainter=c3def0,sRecursionCount=6) >> QWidgetPrivate::drawWidget(this=8016f0,sharedPainter=c3def0,sRecursionCount=7) << QWidgetPrivate::drawWidget(this=8016f0,sharedPainter=c3def0,sRecursionCount=7) >> QWidgetPrivate::drawWidget(this=9636b0,sharedPainter=c3def0,sRecursionCount=7) >> QWidgetPrivate::drawWidget(this=83e730,sharedPainter=c3def0,sRecursionCount=8) QPaintEngine::setSystemClip: Should not be changed while engine is active QPaintEngine::setSystemClip: Should not be changed while engine is active QWidgetPrivate::beginSharedPainter(this=7e17c0,q=7e4a20,tlw=7e4a20,tlwExtra=7e3560,tlwExtra->sharedPainter=c3def0) QWidgetPrivate::beginSharedPainter: Painter is already active >> QWidgetPrivate::drawWidget(this=7e17c0,sharedPainter=c3def0,sRecursionCount=9) >> QWidgetPrivate::drawWidget(this=7e7960,sharedPainter=c3def0,sRecursionCount=10) >> QWidgetPrivate::drawWidget(this=afd870,sharedPainter=c3def0,sRecursionCount=11) >> QWidgetPrivate::drawWidget(this=afda90,sharedPainter=c3def0,sRecursionCount=12) >> QWidgetPrivate::drawWidget(this=7e85c0,sharedPainter=c3def0,sRecursionCount=13) >> QWidgetPrivate::drawWidget(this=7e8850,sharedPainter=c3def0,sRecursionCount=14) >> QWidgetPrivate::drawWidget(this=7ec0c0,sharedPainter=c3def0,sRecursionCount=15) >> QWidgetPrivate::drawWidget(this=9636b0,sharedPainter=c3def0,sRecursionCount=16) >> QWidgetPrivate::drawWidget(this=963b00,sharedPainter=c3def0,sRecursionCount=17) >> QWidgetPrivate::drawWidget(this=83b3e0,sharedPainter=c3def0,sRecursionCount=18) << QWidgetPrivate::drawWidget(this=83b3e0,sharedPainter=c3def0,sRecursionCount=18) << QWidgetPrivate::drawWidget(this=963b00,sharedPainter=c3def0,sRecursionCount=17) >> QWidgetPrivate::drawWidget(this=945000,sharedPainter=c3def0,sRecursionCount=17) >> QWidgetPrivate::drawWidget(this=948db0,sharedPainter=c3def0,sRecursionCount=18) << QWidgetPrivate::drawWidget(this=948db0,sharedPainter=c3def0,sRecursionCount=18) << QWidgetPrivate::drawWidget(this=945000,sharedPainter=c3def0,sRecursionCount=17) << QWidgetPrivate::drawWidget(this=9636b0,sharedPainter=c3def0,sRecursionCount=16) << QWidgetPrivate::drawWidget(this=7ec0c0,sharedPainter=c3def0,sRecursionCount=15) << QWidgetPrivate::drawWidget(this=7e8850,sharedPainter=c3def0,sRecursionCount=14) << QWidgetPrivate::drawWidget(this=7e85c0,sharedPainter=c3def0,sRecursionCount=13) << QWidgetPrivate::drawWidget(this=afda90,sharedPainter=c3def0,sRecursionCount=12) << QWidgetPrivate::drawWidget(this=afd870,sharedPainter=c3def0,sRecursionCount=11) << QWidgetPrivate::drawWidget(this=7e7960,sharedPainter=c3def0,sRecursionCount=10) << QWidgetPrivate::drawWidget(this=7e17c0,sharedPainter=c3def0,sRecursionCount=9) QWidgetPrivate::endSharedPainter(this=7e17c0,q=7e4a20,tlw=7e4a20,tlwExtra=7e3560,tlwExtra->sharedPainter=c3def0) << QWidgetPrivate::drawWidget(this=83e730,sharedPainter=c3def0,sRecursionCount=8) >> QWidgetPrivate::drawWidget(this=963b00,sharedPainter=c3def0,sRecursionCount=8) Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7f4b49c266f0 (LWP 17275)] 0x00007f4b48853a84 in QPaintEngine::isActive (this=0x7f4b008b0f90) at ../../include/QtGui/../../src/gui/painting/qpaintengine.h:148 148 bool isActive() const { return active; } (gdb) SVN commit 880178 by stefanek: Fix and patch for the recursive backingstore sync crash deep in the qt painting code. Certain widget hierarchies caused the painting recursion to "loop back" to the toplevel widget which in turn caused the shared painter to be destroyed and the outer frames to be left with a dangling pointer on the stack. BUG: 174065 CCMAIL: Thomas McGuire <mcguire@kde.org> CCMAIL: Szymon Tomasz Stefanek <s.stefanek@gmail.com> A patches/0256-fix-recursive-backingstore-sync-crash.diff M +1 -1 patches/README M +5 -1 src/gui/painting/qbackingstore.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=880178 *** Bug 175861 has been marked as a duplicate of this bug. *** *** Bug 176115 has been marked as a duplicate of this bug. *** Jaime, please not 176115 was filed against trunk from 25/11/2008, much after the above fix. András, do you have a recent qt-copy with patches applied? Because this is a Qt bug and only fixed in qt-copy right now. (BTW, Szymon, did you get any response about your patch from the Trolls?) > Jaime, please not 176115 was filed against trunk from 25/11/2008, much after the above fix.
It is the same backtrace, so it was correct to mark this as a duplicate. If the same bug reappears, then the original report should be reopened (like you did, but I doubt/hope that this is still an issue).
They have "seen" this problem but nobody did officially acknowledge its existence since there is no simple test case app that shows it. There is probably ongoing work on that part of Qt and there are rumours about qt 4.5 snapshots not being affected even without the patch... so I guess they're assuming that this bug will magically vanish without anybody officially taking care of it. Anyway, Andras: did you reproduce the bug with the patched qt ? The stack trace is almost exactly the same but the exact point of failure is a bit different. This might be caused by missing symbols or a different memory allocation pattern though. Sorry, I missed that the patch is for qt-copy, not kmail. right now I'm not using qt-copy, so I can't test. Let's close it anyway, I'll reopen if I can reproduce with qt-copy+patch. *** Bug 179263 has been marked as a duplicate of this bug. *** *** Bug 180956 has been marked as a duplicate of this bug. *** *** Bug 181595 has been marked as a duplicate of this bug. *** Gentoo users, please file a bug report in gentoo, pointing them to this bug report, so that they can include the qt-copy patch 0256-fix-recursive-backingstore-sync-crash.diff. Thanks. (In reply to comment #15) Patch included in gentoo portage in x11-libs/qt-gui-4.4.2-r2. This problem is present in r1. After upgrading to r2 problem is gone. *** Bug 187632 has been marked as a duplicate of this bug. *** *** Bug 192710 has been marked as a duplicate of this bug. *** |