Bug 250113 - Searching for PHP Executables hangs on circular symlinks
Summary: Searching for PHP Executables hangs on circular symlinks
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Michael Spector CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 250111 275547 330195 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-08 11:51 EDT by Jorrit Schippers CLA
Modified: 2020-05-14 10:16 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jorrit Schippers CLA 2008-10-08 11:51:51 EDT
Searching for installed PHP executables in /usr/bin creates an infinite loop.

My Ubuntu system contains a symbolic link /usr/bin/X11 that points to /usr/bin, thus creating a loop: /usr/bin/X11/X11/X11/X11/php is equal to /usr/bin, etc.

Unfortunately, the PHP executable search engine does not account for this and adds an infinite amount of PHP executables to the list (or at least it tries to do so).

From the comments of InstalledPHPsBlock.search() I deduce that it was borrowed from the "Installed JREs" dialog from the Java plugin (it says: Search for installed VMs in the file system). However, the Installed JREs search engine does not have this problem. This might be because it has been improved in the meantime, and the PHPs panel was forked before that. Perhaps the changes to the Installed JREs panel can be merged such that the PHPs panel does not have this problem anymore.

I filed this under Debugger as this code resides in the org.eclipse.php.debug.ui plugin. I am using the 2.0.0.HEAD version of org.eclipse.php.debug.ui, 2.0.0.HEAD-7H--9qMqC of the PDT Plugin feature and Eclipse 3.4.1.
Comment 1 Jorrit Schippers CLA 2008-10-08 12:53:45 EDT
*** Bug 250111 has been marked as a duplicate of this bug. ***
Comment 2 Michael Spector CLA 2009-06-06 05:05:23 EDT
*** Bug 275547 has been marked as a duplicate of this bug. ***
Comment 3 Erik CLA 2009-06-08 01:48:39 EDT
The scenario that I reported in bug 275547 did not appear to me to be a duplicate of this bug.  I also had recursion on other symlinks and those symlinks did not seem to cause a problem, it was only the symlink with a colon in the name (wine disk) that caused the problem.


If you want to track it as a dup that's fine but be sure to test the 'z:' symlink name as a distinct test case.  There may very well be a missed scenario with that non-standard name.
Comment 4 Zhongwei Zhao CLA 2010-06-16 06:04:21 EDT
Hi

After I installed php on ubuntu,I search for installed PHP executables in /usr/bin,but there is no result.

I used the following command to install php:
    sudo apt-get install apache2

    sudo apt-get install php5

    sudo apt-get install libapache2-mod-php5

    sudo /etc/init.d/apache2 restart
Comment 5 Zhongwei Zhao CLA 2010-07-02 05:54:40 EDT
Hi

I just test it on ubuntu,pdt really has this problem,but jdt as well.
How to reproduce this on jdt?
1.execute command:ln -s /usr/lib/jvm/javaXXX /usr/lib/jvm/javaXXX/newjava
2.then do search jre.

Possible solution:if we find a php,we will stop searching in its sub folder.
Comment 6 Erik CLA 2010-07-03 04:30:35 EDT
on *nix perhaps the most efficient way to locate php would be via the "which" shell command.   I don't know if Eclipse can internally run a shell command, but if it could that would seem an elegant choice to locate a default.  After you find the default then you could allow the user to override.

since I no longer use eclipse I am removing myself from the cc list.

Best of luck
Comment 7 Zhongwei Zhao CLA 2011-04-15 00:57:53 EDT
*** Bug 330195 has been marked as a duplicate of this bug. ***