Bug 184420 - kdevelop-3.5.4 freezes when loading a C++ project
Summary: kdevelop-3.5.4 freezes when loading a C++ project
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: 3.5.4
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-15 16:54 UTC by Albert Zeyer
Modified: 2009-02-15 20:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Zeyer 2009-02-15 16:54:54 UTC
Version:           3.5.4 (using KDE 3.5.9)
Compiler:          GCC 4.3.2-r2 
OS:                Linux
Installed from:    Gentoo Packages

I was just loading some of my C++ projects and kdevelop freezes, e.g. did not
respond anymore.

I filled in a bugreport at Gentoos bugtracker:
http://bugs.gentoo.org/show_bug.cgi?id=259094

You can find there some backtraces with GDB and console output.
Comment 1 Albert Zeyer 2009-02-15 19:07:26 UTC
I fixed the problem:

az@acompneu ~/Programmierung/kdevelop-3.5 $ svn diff
Index: lib/cppparser/lexer.cpp
===================================================================
--- lib/cppparser/lexer.cpp     (revision 926528)
+++ lib/cppparser/lexer.cpp     (working copy)
@@ -241,7 +241,7 @@
         m_startLine = false;
         int ppe = preprocessorEnabled();
        setPreprocessorEnabled( false );
-       while( currentChar() && currentChar() != '\n' ){
+       while( !currentChar().isNull() && currentChar() != '\n' ){
             Token tok(m_source);
             nextToken( tok, true );
         }

It always occurs while parsing any C++ file with some unicode characters.
(bool)currentChar() is false in that case, so it never proceed further at this
character.
Comment 2 Andreas Pakulat 2009-02-15 20:48:17 UTC
SVN commit 926595 by apaku:

Fix endless loop by checking for null-character explicitly instead of relying on a QChar->bool auto-conversion.
Patch by Albert Zeyer - thanks.
BUG:184420


 M  +1 -1      lexer.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=926595