Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 358830

Summary: Very long project refresh with symbolic links on Windows
Product: [Eclipse Project] Platform Reporter: Chris McGee <cbmcgee>
Component: ResourcesAssignee: Szymon Ptaszkiewicz <sptaszkiewicz>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: john.arthorne, Szymon.Brandys
Version: 3.6.1Flags: Szymon.Brandys: review+
Target Milestone: 3.8 M4   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch v1 none

Description Chris McGee CLA 2011-09-25 21:13:19 EDT
It takes a very long time (possibly infinite) to refresh a project after adding certain types of symbolic links using the 'mklink' command on Windows.

It appears that directory-type symbolic links 'mklink /d' with a target of "..\" or ".\" specifically triggers the problem.

After performing some debugging the problem appears to be a regex that does not take into account the windows path segment separator ('\') to avoid recursive symbolic links.

This regex is located in org.eclipse.core.internal.localstore.UnifiedTreee.PatternHolder and has the pattern "\\.[./]*" when it should probably be something like "\\.[./\\]*"
Comment 1 John Arthorne CLA 2011-09-26 15:26:30 EDT
Thanks for the report Chris. Since backslash is a valid path segment on platforms other than windows, I expect we would need a different pattern for the Windows vs. non-Windows case.
Comment 2 Szymon Ptaszkiewicz CLA 2011-10-20 08:25:05 EDT
Created attachment 205618 [details]
Patch v1

I have checked Windows 7 and Linux. On Windows, only symlinks created with a backslash are correct whereas on Linux only with a slash. We should not use one pattern for all platforms because it is possible to create an invalid symlink using wrong separator. For Windows the correct pattern is "\\.[.\\\\]*". The patch contains fix and test that would fail on Windows without the new pattern.
Comment 3 Szymon Ptaszkiewicz CLA 2011-10-20 08:40:43 EDT
John, can you review this patch for me?
Comment 4 Szymon Brandys CLA 2011-11-04 13:20:01 EDT
The patch looks good. Unfortunately we can't determine OS from the file, but we have to use the local OS. But so far we have to live with that like in bug 215214.
Comment 5 Szymon Ptaszkiewicz CLA 2011-11-04 14:54:19 EDT
Thanks! Fixed in master.