Bug#46017: infinite loop in replaceValuesInFiles if project name contains "hello"

nnashok at yahoo.com nnashok at yahoo.com
Thu Aug 1 10:04:02 UTC 2002


Package: kdevelop
Version: 2.1 (using KDE 3.0.0 )
Severity: normal
Installed from:    RedHat RPMs
Compiler:          gcc 2.96
OS:                Linux
OS/Compiler notes: RedHat 7.3 

When creating a new project (of any type I 
think) using Application wizard, if the project 
name contains the word "hello" (case 
insensitive), then the wizard seems to hang as 
when the replaceValuesInFiles in 
/usr/share/apps/kdevelop/tools/processes.pl is 
called with the argument "Makefile.am" in 
/pathj/to/projectname/projectname directory 
(for example Makefile.am in 
/home/nnashok/firsthello/firsthello).

Explanation:
In the subroutine replaceValuesInFiles 
(/usr/share/apps/kdevelop/tools/processes.pl)
the input file ($oldfile) is scanned for 
keywords which are the keys of the hash 
%$hashref and replaced with the values 
($hashref->{$word} where $word takes the value 
of every key in %hashref .

   One of these keywords is "|NAMELITTLE|" 
which is replaced with the project-name in 
small letters (in my case: firsthello). 
|NAMELITTLE| occurs as |NAMELITTLE_LDFLAGS in 
the input file, and on replacement produces 
projectname_LDFLAGS (in my case 
firsthello_LDFLAGS).

   Another keyword that is searched for (after 
searching for |NAMELITTLE|) is "hello_" to be 
replaced with projectname_ (firsthello_ in my 
case). As the above replacement 
(|NAMELITTLE|)has just created the "hello_" (in 
firsthello_LDFLAGS) word to occur in the input 
file, this replacement now produces 
"firstfirsthello_LDFLAGS". This produces a loop 
and hence kdevelop seems to hang (in my case it 
had repeated around 2760 times before i stopped 
it by closing the application wizard).

  I have checked that not using the "hello" 
word in the project name will prevent such a 
loop.

  I think replacing this key "hello_" with 
something similar to the other keys, say 
"|HELLO_|" will take care of the loop as users 
will not use the word "|HELLO_|" in their 
project name.

Thanks,
Ashok


(Submitted via bugs.kde.org)


(Complete bug history is available at http://bugs.kde.org/db/46/46017.html)




More information about the KDevelop-devel mailing list