Bug 46017 - infinite loop in replaceValuesInFiles if project name contains "hello"
Summary: infinite loop in replaceValuesInFiles if project name contains "hello"
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: kdevelop 2.x (obsolete) (show other bugs)
Version: 2.1
Platform: RedHat Enterprise Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KDevelop-Devel List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-01 08:03 UTC by nnashok
Modified: 2002-10-09 22:25 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 nnashok 2002-08-01 08:02:40 UTC
(*** This bug was imported into bugs.kde.org ***)

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)
Comment 1 Caleb Tennis 2002-10-09 22:25:18 UTC
Fixed in Gideon (3.0)