You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Command dotnet run fails with an internal stack overflow error when there is a folder named \ present in the project root. It seems like it encounters an infinite recursion.
Reproduction Steps
Use a Unix-based system that allows a directory to be named \
Create a new empty c# project (you can use dotnet new)
Create a new folder named \ (you can use mkdir \\
Run dotnet run, it will fail on stack overflow likely due to infinite recursion.
Expected behavior
dotnet run builds and runs the project
Actual behavior
dotnet run fails on stack overflow due to infinite recursion. Dotnet 8 shows no stack trace, just says stack overflow. Below is stack trace from dotnet 6.0.0, shortened because it was very long.
mkdir \\
dotnet run
Stack overflow.
at Microsoft.Build.Shared.FileMatcher+<>c__DisplayClass19_0.<.ctor>b__0(FileSystemEntity, System.String, System.String, System.String, Boolean)
at Microsoft.Build.Shared.FileMatcher.GetFilesRecursive(System.Collections.Concurrent.ConcurrentStack`1<System.Collections.Generic.List`1<System.String>>, RecursionState, System.String, Boolean, System.Collections.Generic.IList`1<RecursionState>, System.Collections.Generic.Dictionary`2<System.String,System.Collections.Generic.List`1<RecursionState>>, TaskOptions)
at Microsoft.Build.Shared.FileMatcher+<>c__DisplayClass41_0.<GetFilesRecursive>b__0(System.String)
at Microsoft.Build.Shared.FileMatcher.GetFilesRecursive(System.Collections.Concurrent.ConcurrentStack`1<System.Collections.Generic.List`1<System.String>>, RecursionState, System.String, Boolean, System.Collections.Generic.IList`1<RecursionState>, System.Collections.Generic.Dictionary`2<System.String,System.Collections.Generic.List`1<RecursionState>>, TaskOptions)
at Microsoft.Build.Shared.FileMatcher+<>c__DisplayClass19_0.<.ctor>b__0(FileSystemEntity, System.String, System.String, System.String, Boolean)
at Microsoft.Build.Shared.FileMatcher.GetFilesRecursive(System.Collections.Concurrent.ConcurrentStack`1<System.Collections.Generic.List`1<System.String>>, RecursionState, System.String, Boolean, System.Collections.Generic.IList`1<RecursionState>, System.Collections.Generic.Dictionary`2<System.String,System.Collections.Generic.List`1<RecursionState>>, TaskOptions)
at Microsoft.Build.Shared.FileMatcher+<>c__DisplayClass41_0.<GetFilesRecursive>b__0(System.String)
at Microsoft.Build.Shared.FileMatcher.GetFilesRecursive(System.Collections.Concurrent.ConcurrentStack`1<System.Collections.Generic.List`1<System.String>>, RecursionState, System.String, Boolean, System.Collections.Generic.IList`1<RecursionState>, System.Collections.Generic.Dictionary`2<System.String,System.Collections.Generic.List`1<RecursionState>>, TaskOptions)
... a lot more recursion ...
Microsoft.Build.Shared.FileMatcher.GetFilesRecursive(System.Collections.Concurrent.ConcurrentStack`1<System.Collections.Generic.List`1<System.String>>, RecursionState, System.String, Boolean, System.Collections.Generic.IList`1<RecursionState>, System.Collections.Generic.Dictionary`2<System.String,System.Collections.Generic.List`1<RecursionState>>, TaskOptions)
at Microsoft.Build.Shared.FileMatcher+<>c__DisplayClass41_0.<GetFilesRecursive>b__0(System.String)
at Microsoft.Build.Shared.FileMatcher.GetFilesRecursive(System.Collections.Concurrent.ConcurrentStack`1<System.Collections.Generic.List`1<System.String>>, RecursionState, System.String, Boolean, System.Collections.Generic.IList`1<RecursionState>, System.Collections.Generic.Dictionary`2<System.String,System.Collections.Generic.List`1<RecursionState>>, TaskOptions)
at Microsoft.Build.Shared.FileMatcher+<>c__DisplayClass41_0.<GetFilesRecursive>b__0(System.String)
at System.Threading.Tasks.Parallel+<>c__DisplayClass32_0`2[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<ForEachWorker>b__0(Int32)
at System.Threading.Tasks.Parallel+<>c__DisplayClass19_0`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<ForWorker>b__1(System.Threading.Tasks.RangeWorker ByRef, Int32, Boolean ByRef)
at System.Threading.Tasks.TaskReplicator+Replica.Execute()
at System.Threading.Tasks.TaskReplicator+Replica+<>c.<.ctor>b__4_0(System.Object)
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task+<>c.<.cctor>b__272_0(System.Object)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
at System.Threading.Tasks.Task.ExecuteEntryUnsafe(System.Threading.Thread)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
at System.Threading.Thread.StartCallback()
zsh: abort dotnet run
Regression?
No response
Known Workarounds
Don't create a folder named \
Use Windows or another non-Unix-based OS (not recommended, windows is bad)
Configuration
dotnet 8.0.x fails, dotnet 6.0.0 fails, not tested for other versions.
MacOS Sonoma 14.4, M3 chip, architecture aarch64
Other information
No response
The text was updated successfully, but these errors were encountered:
Description
Command
dotnet run
fails with an internal stack overflow error when there is a folder named\
present in the project root. It seems like it encounters an infinite recursion.Reproduction Steps
\
dotnet new
)\
(you can usemkdir \\
dotnet run
, it will fail on stack overflow likely due to infinite recursion.Expected behavior
dotnet run
builds and runs the projectActual behavior
dotnet run
fails on stack overflow due to infinite recursion. Dotnet 8 shows no stack trace, just saysstack overflow
. Below is stack trace fromdotnet 6.0.0
, shortened because it was very long.Regression?
No response
Known Workarounds
\
Configuration
dotnet 8.0.x
fails,dotnet 6.0.0
fails, not tested for other versions.MacOS Sonoma 14.4, M3 chip, architecture
aarch64
Other information
No response
The text was updated successfully, but these errors were encountered: