question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite Loop with NTFS junctions

See original GitHub issue

On some Windows servers I’m experiencing an infinite loop:

c:\Documents and Settings\WINDOWS_ACCOUNT_HERE\AppData\Local\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Application Data\Microsoft\Windows\History\History.IE5

or

c:\Users\XXXXXX\Application Data\Application Data\Application Data\Application Data\Application Data.…

This is my workaround:

	private boolean isExcludedDirectory(String path) {
		if (isWindows && path.toUpperCase().indexOf("$RECYCLE.BIN") == 3)
			return true;

		//Infinite loop on some systems
		if (isWindows && path.toUpperCase().endsWith("\\APPLICATION DATA\\APPLICATION DATA"))
			return true;

		return (path.equals("/proc") || path.startsWith("/proc/")) || (path.equals("/sys") || path.startsWith("/sys/"))
				|| (path.equals("/dev") || path.startsWith("/dev/")) || (path.equals("/run") || path.startsWith("/run/"))
				|| (path.equals("/var/run") || path.startsWith("/var/run/"));
	}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
IanSJonescommented, Dec 17, 2021

Update - there is an official update out that avoids this “ReparsePoint” - better to use that than the fix above.

1reaction
IanSJonescommented, Dec 17, 2021

yeh - we’re just compiling an exe and will be running this against our 8,000 servers

Read more comments on GitHub >

github_iconTop Results From Across the Web

Robocopy gets into infinite loop on NTFS Junction points
It turns out that robocopy can get stuck in an infinite loop on the junction point if you are copying windows users. You...
Read more >
Indexer can get caught in an infinite loops of NTFS junctions ...
There are a couple of obvious solutions: Don't traverse past reparse points. This is easy to implement, but prevents indexing through all ...
Read more >
Can an infinite loop in junction point folders cause missing disk
Yes, this is a classic infinite Loop that can be caused by running a program that is not aware of Soft Links (Junction...
Read more >
Many/many files, long path names, NTFS junction ... - voidtools
10+ million files is no problem. Long path names. No problem. NTFS junction loops? Everything doesn't "follow" junctions, so no loops .
Read more >
View topic - NTFS junctions - infinite loop - ClamWin Free Antivirus
Hi, I have an NTFS filesystem with some junction points in it: c:\junctions\c-drive -> c:\ c:\junctions\d-drive -> d:\ clamscan is not alone in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found