This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 208392 - Scanning project with multiple symlinks does not end if placed in symlinked folder
Summary: Scanning project with multiple symlinks does not end if placed in symlinked f...
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 7.1.1
Hardware: All Unix
: P1 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on: 237882
Blocks:
  Show dependency tree
 
Reported: 2012-02-14 13:46 UTC by Tomas Danek
Modified: 2015-01-31 07:57 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 186376


Attachments
Infinite loop in crawler (18.51 KB, application/x-nps)
2012-02-25 10:30 UTC, Jaroslav Tulach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Danek 2012-02-14 13:46:57 UTC
Product Version: NetBeans IDE 7.1.1 RC1 (Build 201202132200)
Java: 1.6.0_29; Java HotSpot(TM) 64-Bit Server VM 20.4-b02-402
System: Mac OS X version 10.7.3 running on x86_64; MacRoman; en_US (nb)
User directory: /Users/tomas/.netbeans/7.1.1rc1
Cache directory: /Users/tomas/.netbeans/7.1.1rc1/var/cache
-------------------------------------------------------------------
issue 207214 fixes infinite scanning on linux, on mac os problem remains. To reproduce:

- download and open project 'example' from issue 206461
(http://netbeans.org/bugzilla/attachment.cgi?id=114264)
- scanning gets stuck at 100% during scanning project itself

this is blocker for 7.1.1
Comment 1 Jaroslav Tulach 2012-02-20 08:33:49 UTC
I don't have access Mac OS X to test and fix this problem.
Comment 2 Tomas Danek 2012-02-20 09:37:28 UTC
I think i figured out the difference - difference is not OS, but where you put your project:
When I unpack sample project into:
1) home folder (ordinary folder), everything works fine
2) tmp (where /tmp -> private/tmp) problem occurs. 

Can you confirm on linux?
Comment 3 Petr Cyhelsky 2012-02-20 09:51:07 UTC
you are right, on linux when I open the project from directory, which itself is a symlink to other dir, the scanning never ends
Comment 4 Tomas Danek 2012-02-20 09:55:35 UTC
thanks!
Comment 5 Jaroslav Tulach 2012-02-25 10:30:40 UTC
Created attachment 116102 [details]
Infinite loop in crawler

I tried to simulate the problem in b37994c01837, but the addRecursiveListener seems robust. Thus I tried the create a profiling snapshot and it seems, the problem is in crawler, not in the recursive listener.
Comment 6 Quality Engineering 2012-02-26 11:15:53 UTC
Integrated into 'main-golden', will be available in build *201202260400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/b37994c01837
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #208392: Unsuccessfully trying to simulate the problem
Comment 7 Tomas Zezula 2012-02-29 12:20:21 UTC
Fixed jet-main eab0e72268c9
Comment 8 Quality Engineering 2012-03-01 10:59:50 UTC
Integrated into 'main-golden', will be available in build *201203010400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/eab0e72268c9
User: Tomas Zezula <tzezula@netbeans.org>
Log: #208392:Scanning project with multiple symlinks does not end if placed in symlinked folder
Comment 9 Tomas Zezula 2012-03-27 11:18:26 UTC
Mariane, shouldn't this be a part of the patch?
Comment 10 Petr Cyhelsky 2012-03-27 11:29:41 UTC
yes it should be part of patch - please backport the fix into releases/release71_fixes branch
Comment 11 Marian Mirilovic 2012-03-27 13:18:23 UTC
(In reply to comment #10)
> yes it should be part of patch - please backport the fix into
> releases/release71_fixes branch

+1
Comment 12 Marian Mirilovic 2012-03-29 08:30:30 UTC
Tomas, 
please proceed with integration into release71_fixes branch and follow
http://wiki.netbeans.org/NetBeansPatchesProcess . Thanks in advance.
Comment 13 Tomas Zezula 2012-04-04 08:51:24 UTC
Transplanted into releases71_fixes d19def475075, 3856473efbc8
Comment 14 Quality Engineering 2012-04-05 01:19:48 UTC
Integrated into 'releases', will be available in build *201204042205* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/d19def475075
User: Tomas Zezula <tzezula@netbeans.org>
Log: #208392:Scanning project with multiple symlinks does not end if placed in symlinked folder
Comment 15 Jiri Prox 2012-04-06 14:46:50 UTC
Tomasi, can you please verify it, I don't have a mac, thanks
Comment 16 Tomas Danek 2012-04-10 05:08:34 UTC
Sacnning has finished properly; verified

Product Version: NetBeans IDE 7.1.2 (Build 201204052205)
Java: 1.7.0_04-ea; Java HotSpot(TM) 64-Bit Server VM 23.0-b20
System: Mac OS X version 10.7.3 running on amd64; US-ASCII; en_US (nb)
User directory: /Users/tomas/.netbeans/7.1.2
Cache directory: /Users/tomas/.netbeans/7.1.2/var/cache
Comment 17 Alexander Simon 2014-11-21 16:03:42 UTC
Fix does not work for remote file system.
I have infinite crawling, Stack:
"RepositoryUpdater.worker" #53 daemon prio=1 os_prio=64 tid=0x0000000006648000 nid=0x3d at breakpoint[0xffff80ffa63f9000]
   java.lang.Thread.State: RUNNABLE
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collect(FileObjectCrawler.java:275)
	at org.netbeans.modules.parsing.impl.indexing.FileObjectCrawler.collectResources(FileObjectCrawler.java:198)
	at org.netbeans.modules.parsing.impl.indexing.Crawler.init(Crawler.java:201)
	at org.netbeans.modules.parsing.impl.indexing.Crawler.getResources(Crawler.java:105)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$AbstractRootsWork.scanSource(RepositoryUpdater.java:5512)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$AbstractRootsWork.scanSources(RepositoryUpdater.java:5255)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$RootsWork.getDone(RepositoryUpdater.java:4892)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Work.doTheWork(RepositoryUpdater.java:3330)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task._run(RepositoryUpdater.java:5985)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.access$2700(RepositoryUpdater.java:5644)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$3$1.run(RepositoryUpdater.java:5910)
	at org.netbeans.modules.parsing.impl.RunWhenScanFinishedSupport.performScan(RunWhenScanFinishedSupport.java:95)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$3.call(RepositoryUpdater.java:5906)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task$3.call(RepositoryUpdater.java:5902)
	at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:176)
	at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:360)
	at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:141)
	at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:87)
	at org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater$Task.run(RepositoryUpdater.java:5902)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1425)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:59)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:294)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2038)
Comment 18 Alexander Simon 2014-11-21 16:05:00 UTC
FO path:
.../sparc-S2/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/
Comment 19 Alexander Simon 2014-11-21 16:06:12 UTC
(In reply to Alexander Simon from comment #18)
> FO path:
> .../sparc-S2/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/
> compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/
> compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/
> compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/compilers/sys/lib/
> compilers/

Folder sys is a symbolic link to ../..
Comment 20 Vladimir Kvashin 2014-11-24 04:54:40 UTC
Does this mean that we need to extend file system API to let clients deal with symbolic links?
Comment 21 Vladimir Kvashin 2014-11-24 05:01:11 UTC
The root cause is that FileUtil.toFile() returns null for such file object, so isLink() check is not performed.
Comment 22 Tomas Zezula 2014-11-24 10:40:40 UTC
OK, thanks Vladimir!
I will look at it.
Comment 23 Vladimir Kvashin 2014-11-24 11:49:39 UTC
This is hardly possible to reproduce without remote host setup; we have some tests infrastructure that creates remote file objects, but there is no docs at all, and I need to check whether it works for external use. If you need, I can do this and also write a brief description.

And now there is no API that allows to determine whether file object is a link or no (if it does not correspond to java.io.File). I think we need to introiduce such API.
Comment 24 Tomas Zezula 2014-11-24 13:01:16 UTC
I understand.
The problem occurs only on remote file system where the FU.toFile(FO):File returns null.
The parsing.api can use FileUtil.isRecursiveSymLink() which was not available, the enhancement for it comes as a part of this issue. However there is no SPI for the FileSystem to plug into the FileUtil.isRecursiveSymlink.
So such a SPI should be introduced.

So I will update the parsing.api to use FileUtil.isRecursiveSymLink() and create a new issue on platform/fs.
Comment 25 Vladimir Kvashin 2014-11-26 06:16:04 UTC
It seems there already is sucn an issue 237882 - Provide API for detection and handling of symlinks
Comment 26 Tomas Zezula 2015-01-30 15:25:20 UTC
Fixed jet-main 992778fd966e
Comment 27 Quality Engineering 2015-01-31 07:57:22 UTC
Integrated into 'main-silver', will be available in build *201501310002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/992778fd966e
User: Tomas Zezula <tzezula@netbeans.org>
Log: #208392:Scanning project with multiple symlinks does not end if placed in symlinked folder