[Bug 78978] Runs out of memory when importing generic C++ project

Bernhard Ãœbelacker huafbauer at compuserve.de
Thu Apr 15 22:13:06 UTC 2004


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
      
http://bugs.kde.org/show_bug.cgi?id=78978      




------- Additional Comments From huafbauer compuserve de  2004-04-15 20:50 -------
Probably it's because of a too high grade of Macro usage like in file:
http://savannah.nongnu.org/cgi-bin/viewcvs/qemu/qemu/alpha-dis.c?rev=1.2&content-type=text/vnd.viewcvs-markup

The import goes fine until this file is reached. Then the memory is filled in
about 10 seconds and the machine stays unresponsive for about 4 minutes
(until the kernel kills some processes ;-) )

If the preprocessing of this file is turned off then the import finished successfully.
(Is the preprocessing needed at all?)

qemu/alpha-dis.c (1964 lines, 80,5KB)
165623 Tokens with preprocessing
 17853 Tokens without preprocessing
(counted without the "ADD_TOKEN( tk );" in lexer.cpp:488)

Are these numbers not in the normal range?
If the number of tokens for this file is normal
how are chances the Qt build has a bug (QPtrVector)?

SuSE 9.0 with KDE 3.2.0 (QT 3.3.0)
kdevelop-cvs 2004-04-11

Mit freundlichen Grüßen
Bernhard Übelacker


(disables the preprocessing on tokenizing)
--- kdevelop-cvs.original/kdevelop/lib/cppparser/driver.cpp	2003-12-18 20:06:57.000000000 +0100
+++ kdevelop-cvs/kdevelop/lib/cppparser/driver.cpp	2004-04-14 21:13:19.000000000 +0200
 @ -239,6 +239,7  @
     Lexer lex( this );
     lexer = &lex;
     setupLexer( &lex );
+    lex.setPreprocessorEnabled(false);
 
     lex.setSource( sourceProvider()->contents(fileName) );



(logs also the filename of the file to be parsed)
--- kdevelop-cvs.original/kdevelop/languages/cpp/cppsupportpart.cpp	2004-04-10 20:53:52.000000000 +0200
+++ kdevelop-cvs/kdevelop/languages/cpp/cppsupportpart.cpp	2004-04-14 20:48:14.000000000 +0200
 @ -915,7 +915,7  @
 					} 
 					else 
 					{
-						kdDebug(9007) << "newly parsing..." << endl;
+						kdDebug(9007) << "newly parsing... " << absFilePath << endl;
 						m_driver->parseFile( absFilePath );
 					}
 			

.




More information about the KDevelop-devel mailing list