Summary: | Kdevelop crashes by Event onClick Documentation SiteBar | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Juergen Heinemann <nospam> |
Component: | doctreeview | Assignee: | KDevelop Developers <kdevelop-devel> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | a.lucas, berk, franke.daniel, guitarm, iacpapal, johnfulgor, nagytam, samuele_catuzzi, simanzoko |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Patch from comment #6 as an attachment. |
Description
Juergen Heinemann
2004-03-02 12:34:31 UTC
Dupe *** This bug has been marked as a duplicate of 69441 *** Ok, Sorry i didn't find it in Bug Search. Opening again. Yes, this is another KStyle related problem, but at least I know how to fix it ;) If you replace DocTreeViewWidget::projectChanged method with void DocTreeViewWidget::projectChanged(KDevProject *project) { folder_project->setProject(project); QTimer::singleShot(0, this, SLOT(refresh())); } you will fix the bug :) The only reason I haven't commited yet is that this introduce a large delay during opening a project. Also it crashes only with Qt>=3.3beta. It seems that if we use QListView::takeItem then for some reason the crash in KStyle occurs when repainting the listview. Reproducable for me when I open a project, close it, then open same or other project and click on documentation tool button. *** Bug 77728 has been marked as a duplicate of this bug. *** I've encountered a very similar problem except in QWindowsStyle::drawComplexControl(). Causes crashes on open or close of a new project only when the documentation tab is showing. The following patch (against Qt) is a band-aid for the problem. Please pass it on to the Trolltech guys if you think it worthwhile. (debug kernel 2.6.3.2.1.258-2-1, KDE 3.2.1, Fedora Core 2 test 1 Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.3.3 20040311 (Red Hat Linux 3.3.3-3) --- qwindowsstyle.cpp 2004-02-18 08:22:55.000000000 -0500 +++ qwindowsstyle.cpp.backup 2004-03-20 20:09:52.576762328 -0500 @@ -1624,7 +1624,16 @@ } else { int linetop = 0, linebot = 0; + int numchildren = 0; // each branch needs at most two lines, ie. four end points dotoffset = (item->itemPos() + item->height() - y) %2; - dotlines.resize( item->childCount() * 4 ); + numchildren = item->childCount(); + if (numchildren < 0) { + printf("QWindowsStyle::drawComplexControl: Bogus number of child items (%d) in listview\n",numchildren); + numchildren = 0; + } + dotlines.resize( numchildren * 4 ); + if (numchildren == 0) { + child = NULL; + } c = 0; Oop! I should also mention that was Qt 3.3.1. *** Bug 78605 has been marked as a duplicate of this bug. *** Was just looking at the other bug originally sited as a duplicate. I should add that the crash is happening because a bad ListViewItem is being passed down. The drawComplexControl() method retrieves a negative (or otherwise out-of-range) value for the item's number of children and blows up since it doesn't perform a check. My patch above fixes the blowup but it doesn't address the bad item that's being passed. I think the problem is our use of the takeItem() method. (See http://doc.trolltech.com/3.3/qlistviewitem.html#takeItem ) The method is known to leave the listviewitem in an "unsafe state". Apparently, the style drawing code doesn't always (ever?) handle this safely. Maybe this is a bug in the drawing code, but we're not likely to get the fix into all 20+ qt/kde-styles that exist.. I guess our best option is to work around the problem in our code. Created attachment 5454 [details] Patch from comment #6 as an attachment. After trying to reapply the above patch (I'd lost the original) I determined that pasting it in here caused it to be mangled into unusability so I provide it again as an attachment. If any additional help: qt-3.3.1, KDE-3.2.1, kdevelop-HEAD-2004/03/30 Open/create simple c project (c++, qmake seem to work), open documentation, crash. -- gdb-- kdevelop (cpp support): newly parsing... kdevelop (cpp support): updating sourceinfo kdevelop: ClassViewPart::refresh kmdi: KMdiDockContainer::tabClicked() kmdi: KMdiFocusList::addWidgetTree: adding toplevel kmdi: KMdiFocusList::addWidgetTree: adding toplevel kmdi: KMdiFocusList::addWidgetTree: adding widget kmdi: KMdiFocusList::addWidgetTree: adding widget kmdi: KMdiFocusList::addWidgetTree: adding widget kmdi: KMdiFocusList::addWidgetTree: adding widget kmdi: KMdiFocusList::addWidgetTree: adding widget kmdi: KMdiFocusList::addWidgetTree: adding widget QGArray::at: Absolute index 0 out of range Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 16384 (LWP 9673)] 0x410acc53 in KStyle::drawComplexControl(QStyle::ComplexControl, QPainter*, QWidget const*, QRect const&, QColorGroup const&, unsigned, unsigned, unsigned, QStyleOption const&) const (this=0x8179ac0, control=CC_ListView, p=0xbfffe280, widget=0x82f2808, r=@0xbfffe010, cg=@0x8177c64, flags=1, controls=6, active=0, opt=@0xbfffdfd0) at kstyle.cpp:1215 1215 dotlines[c++] = QPoint( bx, linetop ); --backtrace (truncated)-- backtrace: #0 0x410acc53 in KStyle::drawComplexControl(QStyle::ComplexControl, QPainter*, QWidget const*, QRect const&, QColorGroup const&, unsigned, unsigned, unsigned, QStyleOption const&) const (this=0x8179ac0, control=CC_ListView, p=0xbfffe280, widget=0x82f2808, r=@0xbfffe010, cg=@0x8177c64, flags=1, controls=6, active=0, opt=@0xbfffdfd0) at kstyle.cpp:1215 #1 0x4206497b in KeramikStyle::drawComplexControl(QStyle::ComplexControl, QPainter*, QWidget const*, QRect const&, QColorGroup const&, unsigned, unsigned, unsigned, QStyleOption const&) const (this=0x8179ac0, control=CC_ListView, p=0xbfffe280, widget=0x82f2808, r=@0xbfffe010, cg=@0x8177c64, flags=1, controls=6, active=0, opt=@0xbfffdfd0) at keramik.cpp:2291 #2 0x414dc6f5 in QListViewItem::paintBranches(QPainter*, QColorGroup const&, int, int, int) (this=0x82f31a0, p=0xbfffe280, cg=@0x8177c64, w=20, y=0, h=108) at widgets/qlistview.cpp:2240 #3 0x414df4e4 in QListView::drawContentsOffset(QPainter*, int, int, int, int, int, int) (this=0x82f2808, p=0xbfffe280, ox=0, oy=0, cx=0, cy=0, cw=21, ch=750) at widgets/qlistview.cpp:3004 #4 0x4151e3bd in QScrollView::viewportPaintEvent(QPaintEvent*) ( this=0x82f2808, pe=0xbfffe970) at widgets/qscrollview.cpp:1704 #5 0x40c8f79d in KListView::viewportPaintEvent(QPaintEvent*) (this=0x82f2808, e=0xbfffe970) at klistview.cpp:1882 #6 0x4151db3f in QScrollView::eventFilter(QObject*, QEvent*) (this=0x82f2808, obj=0x82f66e8, e=0xbfffe970) at widgets/qscrollview.cpp:1490 #7 0x414e22b7 in QListView::eventFilter(QObject*, QEvent*) (this=0x82f2808, o=0x82f66e8, e=0xbfffe970) at widgets/qlistview.cpp:3827 #8 0x413cd465 in QObject::activate_filters(QEvent*) (this=0x82f66e8, e=0xbfffe970) at kernel/qobject.cpp:902 If anable all documents in all colections in "Project options"->"Project Documentation" this bug disapire. Kdevelop crashes onli if some documentation disabled. *** Bug 76921 has been marked as a duplicate of this bug. *** I must confirm this. My KDevelop 3.0.1 on KDE 3.2.0 (Mandrake Linux 10) craches when I: open new project - "Sample KDE Application" close that project open new project - "Sample KDE Application" click Documentation on the left side -> CRASH *** Bug 79672 has been marked as a duplicate of this bug. *** Fixed in HEAD. New documentation viewer is not vulnerable to this problem. *** Bug 69441 has been marked as a duplicate of this bug. *** *** Bug 81997 has been marked as a duplicate of this bug. *** *** Bug 82490 has been marked as a duplicate of this bug. *** *** Bug 82490 has been marked as a duplicate of this bug. *** |