KDevelop crash in KWriteDoc

Kurre Ståhlberg kurre.stahlberg at reach-u.com
Mon Jul 23 18:24:35 UTC 2001


On Thursday 19 July 2001 11:55, you wrote:
> I've been having problems using KDevelop for a couple of days now. It
> crashes with the following backtrace:
[...]
> and the following output to the konsole:
[...]
> I've tried to compile it with --enable-debug but then it crashes with
> SIGSEGV instantly before even showing anything, and gdb's output wasn't
> useful (Only lines with ??'s).

This I got around. Looks like it was GCC 2.96 problem.

> KDevelop does this to me every time I try to open an recent project, or
> just open a file.

And this looks like it happens when trying to open some file. Not all files 
cause crash, but most of them do.

> This might be because of some old libraries/whatever, and I've tried to
> 'make uninstall' and 'make -f admin/Makefile.common cvs-clean' before
> building everything again, but it doesn't seem to help.

I've been trying to solve this problem myself for couple of days now, and I 
strongly suspect that it has something to do with my setup, since nobody else 
seems to have had this problem and I get it all the time. I even did a clean 
check out from CVS, but no help. 

Anyway, I got the --enable-debug version running and got more useful 
backtrace:

0x413ab519 in __wait4 () from /lib/i686/libc.so.6
#0  0x413ab519 in __wait4 () from /lib/i686/libc.so.6
#1  0x4141b9e4 in __DTOR_END__ () from /lib/i686/libc.so.6
#2  0x409c7165 in KCrash::defaultCrashHandler () at eval.c:41
#3  <signal handler called>
#4  0x40058d46 in KWriteDoc::paintTextLine (this=0x84d26e0, paint=@0xbfffe614,
    line=24, xStart=-2, xEnd=922, showTabs=false) at kwdoc.cpp:2227
#5  0x4004aa01 in KWriteView::paintEvent (this=0x84e26f8, e=0xbfffe880)
    at kwview.cpp:1311
#6  0x40dada8e in QWidget::event () from /usr/local/qt/lib/libqt.so.2
#7  0x4004882a in KWriteView::event (this=0x84e26f8, e=0xbfffe880)
    at kwview.cpp:411
#8  0x40cd2a1e in QApplication::notify () from /usr/local/qt/lib/libqt.so.2
#9  0x4092c957 in KApplication::notify () at eval.c:41
#10 0x40cc8762 in QWidget::repaint () from /usr/local/qt/lib/libqt.so.2
#11 0x400498f9 in KWriteView::updateView (this=0x84e26f8, flags=0, newXPos=0,
    newYPos=0) at kwview.cpp:818
#12 0x40057177 in KWriteDoc::updateViews (this=0x84d26e0, exclude=0x0)
    at kwdoc.cpp:1366
#13 0x400597f3 in KWriteDoc::setFileName (this=0x84d26e0, s=@0xbfffead8)
    at kwdoc.cpp:2608
#14 0x4004c6f8 in KWrite::setFileName (this=0x84e1f80, s=@0xbfffead8)
    at kwview.cpp:1697
#15 0x806d1bd in DocViewMan::doSwitchToFile (this=0xbfffead8,
    filename=0xbfffead8, line=34, col=0, bForceReload=false,
    bShowModifiedBox=true) at ceditwidget.h:48
#16 0x809ebdf in CKDevelop::switchToFile (this=0xbfffeb90,
    filename=0xbfffeb90, line=34, col=0, bForceReload=false,
    bShowModifiedBox=true) at ckdevelop_noslot.cpp:616
#17 0x8099c47 in CKDevelop::CVGotoDefinition (this=0x82e4ba8,
    parentPath=0x849f030 "",
    itemName=0x84cc728 "main(int argc, char * argv[])", parentType=THFOLDER,
    itemType=THGLOBAL_FUNCTION) at ckdevelop_classview.cpp:766
#18 0x8093e03 in CKDevelop::slotCVViewDefinition (this=0x82e4ba8,
    parentPath=0x849f030 "",
    itemName=0x84cc728 "main(int argc, char * argv[])", parentType=THFOLDER,
    itemType=THGLOBAL_FUNCTION) at ckdevelop_classview.cpp:155
#19 0x816748c in CClassView::selectedViewDefinition (this=0x830c0a0,
    t0=0x849f030 "", t1=0x84cc728 "main(int argc, char * argv[])", 
    t2=THFOLDER, t3=THGLOBAL_FUNCTION) at cclassview.moc:734
#20 0x815fdd4 in CClassView::slotViewDefinition (this=0x830c0a0,
    parentPath=0x849f030 "",
    itemName=0x84cc728 "main(int argc, char * argv[])", parentType=THFOLDER,
    itemType=THGLOBAL_FUNCTION) at cclassview.cpp:601
#21 0x81643cb in CClassView::slotViewDefinition (this=0x830c0a0)
    at cclassview.cpp:1435
#22 0x8162bcc in CClassView::slotClassViewSelected (this=0x830c0a0)
    at cclassview.cpp:1218
#23 0x407a22ad in KListView::executed () at eval.c:41
#24 0x4079b86a in KListView::emitExecute () at eval.c:41
#25 0x4079c1ad in KListView::slotMouseButtonClicked () at eval.c:41
#26 0x40eb84cb in QListView::mouseButtonClicked ()
   from /usr/local/qt/lib/libqt.so.2
#27 0x40e0f79c in QListView::contentsMouseReleaseEvent ()
   from /usr/local/qt/lib/libqt.so.2
#28 0x4079c087 in KListView::contentsMouseReleaseEvent () at eval.c:41
#29 0x40e5be6c in QScrollView::viewportMouseReleaseEvent ()
   from /usr/local/qt/lib/libqt.so.2
#30 0x40e5b955 in QScrollView::eventFilter () from 
/usr/local/qt/lib/libqt.so.2
#31 0x40e0e651 in QListView::eventFilter () from /usr/local/qt/lib/libqt.so.2
#32 0x40d46754 in QObject::activate_filters ()
   from /usr/local/qt/lib/libqt.so.2
#33 0x40dad3ea in QWidget::event () from /usr/local/qt/lib/libqt.so.2
#34 0x40cd2a1e in QApplication::notify () from /usr/local/qt/lib/libqt.so.2
#35 0x4092c957 in KApplication::notify () at eval.c:41
#36 0x40c96d03 in QETWidget::translateMouseEvent ()
   from /usr/local/qt/lib/libqt.so.2
#37 0x40c94143 in QApplication::x11ProcessEvent ()
   from /usr/local/qt/lib/libqt.so.2
#38 0x40c92f80 in QApplication::processNextEvent ()
   from /usr/local/qt/lib/libqt.so.2
#39 0x40cd4eef in QApplication::enter_loop () from 
/usr/local/qt/lib/libqt.so.2
#40 0x40c92efe in QApplication::exec () from /usr/local/qt/lib/libqt.so.2
#41 0x80e54b7 in main (argc=1, argv=0xbffff8fc) at main.cpp:211
#42 0x4130d177 in __libc_start_main (main=0x80e44d0 <main>, argc=1, 
    ubp_av=0xbffff8fc, init=0x8061cf0 <_init>, fini=0x81f8f60 <_fini>,
    rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff8ec)
    at ../sysdeps/generic/libc-start.c:129

After some looking into the code, it looks like the tabWidth variable is 0 
when entering the lines 

2226    if (ch == '\t') {
2227	x += tabWidth - (x % tabWidth);
2228    } else {
2229      a = &attribs[textLine->getAttr(z)];
2230      x += a->fm.width(ch);//a->width(ch);
2231    }

in kwdoc.cpp, in method KWriteDoc::paintTextLine (lines 2226-2231). I added a 
kdDebug() << x << tabWidth << "\n" call just to see for sure and indeed it 
was 0.

obviously this crashes when ch=='\t' and tabWidth==0. I have absolutely no 
idea why tabWidth is 0, since I had it set to 2, changed it to 8 and clicked 
ok, exited KDevelop, restarted it, checked that it was still 8, tried again 
and boom. 

--
Kurre

-
to unsubscribe from this list send an email to kdevelop-devel-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop-devel mailing list