Bug 173924 - KDevelop hangs on recursive symlink importing C++ project with custom makefile
Summary: KDevelop hangs on recursive symlink importing C++ project with custom makefile
Status: RESOLVED WORKSFORME
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-30 21:15 UTC by Michael
Modified: 2009-01-23 23:55 UTC (History)
1 user (show)

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 Michael 2008-10-30 21:15:26 UTC
Version:           3.5.3 (using KDE 4.1.2)
Compiler:          gcc (Ubuntu 4.3.2-1ubuntu11) 4.3.2 
OS:                Linux
Installed from:    Ubuntu Packages

When importing a custom makefile C++ project containing a recursive symlink, KDevelop hangs and must be hard-terminated.

Steps to reproduce:

1) Start KDevelop IDE for C/C++
2) Select Project/Import existing project
3) Select a project directory containing a recursive symlink somewhere beneath it
4) Fill in everything else and continue up until "Populate the project"

The hang occurs in the method CustomProjectPart::findNewFiles() in buildtools/custommakefiles/customprojectpart.cpp. This function descends into directories recursively without checking for recursive symlinks.

Possibly a duplicate of bug 103297, but definitely not fixed.  Reported in Ubuntu Launchpad as
https://bugs.launchpad.net/ubuntu/+source/kdevelop/+bug/291148
Comment 1 Andreas Pakulat 2008-11-01 16:39:11 UTC
SVN commit 878661 by apaku:

Make sure we don't descend into recursive links when trying to find new files.
CCBUG: 173924


 M  +23 -1     customprojectpart.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=878661
Comment 2 Andreas Pakulat 2008-11-01 16:41:26 UTC
As you can see above I added extra logic to not descend into recursive links, however I couldn't reproduce the problem with a simple project before changing this. 

The project had a link pointing back up to its grandparent directory and the recursive algorithm stopped at a certain depth, possibly due to QFileInfo not being able to handle the length of the path or something similar. So maybe thats the difference between my system and yours and the original reporters from bug #103279.
Comment 3 Michael 2008-11-03 13:21:40 UTC
I applied the patch manually to my Ubuntu package, with the result that "Populate the project" now completes and offers me a list of the immediate sub-directories of the main project directory, minus the one which contains the recursive link inside its tree (which is fine for me, but may not be what was intended).  However, on the next step I get a hang inside FileGroupsWidget::allFilesRecursively() in parts/fileview/filegroupswidget.cpp.
Comment 4 Andreas Pakulat 2008-11-03 15:01:25 UTC
Hmm, that would indeed not be intended, but it works just fine here. I do get the files inside the directory that has the recursive link. It just doesn't try to decend into the recursive link.

About the filegroups widget: I'm not going to dive into long unmaintained code to fix an issue with something thats generally considered bad practice. Sorry, the only way to avoid that is disabling the filegroups plugin.
Comment 5 Andreas Pakulat 2009-01-23 23:55:23 UTC
as I explained I can't reproduce the problem and filegroups is simply dead.