Background parser not threadsafe

John Firebaugh jfirebaugh at kde.org
Wed Apr 16 08:33:05 UTC 2003


Roberto, can you please take a look at this?

I experienced a freeze of gideon (100% cpu). I sent a SIGABRT to it and got 
the following backtrace. Note that KateDocument methods are being called from 
a thread. This is not OK, as these methods are almost surely not threadsafe.

0x4190db89 in wait4 () from /lib/libc.so.6
#0  0x4190db89 in wait4 () from /lib/libc.so.6
#1  0x41981000 in sys_sigabbrev () from /lib/libc.so.6
#2  0x41732061 in waitpid () from /lib/libpthread.so.0
#3  0x40d665c3 in KCrash::defaultCrashHandler(int) (sig=6)
    at /home/john/src/kde/kdelibs/kdecore/kcrash.cpp:235
#4  0x4189a9d8 in sigaction () from /lib/libc.so.6
#5  0x42a30454 in QPtrList<KateBufBlock>::next() (this=0x9187a60)
    at /home/john/src/kde/qt-copy/include/qptrlist.h:96
#6  0x42a2d4eb in KateBuffer::findBlock(unsigned) (this=0x91879e8, i=3768)
    at /home/john/src/kde/kdelibs/kate/part/katebuffer.cpp:392
#7  0x42a2e8f6 in KateBuffer::textLine(unsigned, bool) (this=0x91879e8, 
    i=3768, withoutTrailingSpaces=false)
    at /home/john/src/kde/kdelibs/kate/part/katebuffer.cpp:902
#8  0x42a2f000 in KateBuffer::text() (this=0x91879e8)
    at /home/john/src/kde/kdelibs/kate/part/katebuffer.cpp:1046
#9  0x42a4e494 in KateDocument::text() const (this=0x97048b0)
    at /home/john/src/kde/kdelibs/kate/part/katedocument.cpp:641
#10 0x425f1953 in KDevSourceProvider::contents(QString const&) (
    this=0x8747fe8, fileName=@0xbf7ffa7c)
    at /home/john/src/kde/kdevelop/parts/cppsupport/backgroundparser.cpp:176
#11 0x425b6a0d in Driver::parseFile(QString const&, bool, bool) (
    this=0x8403890, fileName=@0xbf7ffa7c, onlyPreProcess=false, force=false)
    at /home/john/src/kde/kdevelop/parts/cppsupport/driver.cpp:239
#12 0x425ef08c in BackgroundParser::parseFile(QString const&) (this=0x835abb8, 
    fileName=@0xbf7ffa7c)
    at /home/john/src/kde/kdevelop/parts/cppsupport/backgroundparser.cpp:276
#13 0x425ef29b in BackgroundParser::findOrCreateUnit(QString const&, bool) (
    this=0x835abb8, fileName=@0xbf7ffa7c, force=true)
    at /home/john/src/kde/kdevelop/parts/cppsupport/backgroundparser.cpp:302
#14 0x425ef5a5 in BackgroundParser::run() (this=0x835abb8)
    at /home/john/src/kde/kdevelop/parts/cppsupport/backgroundparser.cpp:368
#15 0x4112f67c in QThreadPrivate::start(QThread*) (thread=0x835abb8)
    at kernel/qthread_unix.cpp:79
#16 0x4112e7c5 in start_thread (_arg=0x86017a0) at kernel/qthread_unix.cpp:98
#17 0x4172dd53 in pthread_start_thread () from /lib/libpthread.so.0




More information about the KDevelop-devel mailing list