Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358830 - Very long project refresh with symbolic links on Windows
Summary: Very long project refresh with symbolic links on Windows
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 3.8 M4   Edit
Assignee: Szymon Ptaszkiewicz CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-25 21:13 EDT by Chris McGee CLA
Modified: 2011-11-04 14:54 EDT (History)
2 users (show)

See Also:
Szymon.Brandys: review+


Attachments
Patch v1 (3.75 KB, patch)
2011-10-20 08:25 EDT, Szymon Ptaszkiewicz CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.