Skip to content

Unix file enumerator isn't thread safe #24295

@JeremyKuhne

Description

@JeremyKuhne

New test in dotnet/corefx#25426 uncovered this.

Unhandled Exception of Type System.NullReferenceException
Message :
System.NullReferenceException : Object reference not set to an instance of an object.
Stack Trace :
   at Interop.Sys.ReadDir(SafeDirectoryHandle dir, DirectoryEntry& outputEntry)
   at System.IO.UnixFileSystem.FileSystemEnumerable`1.<Enumerate>d__11.MoveNext()
   at System.IO.Tests.Regressions.ThreadSafeRepro.Race(IEnumerator`1 s) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.IO.FileSystem/tests/Directory/Regressions.cs:line 30
   at System.IO.Tests.Regressions.ThreadSafeRepro.Execute(String directory) in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.IO.FileSystem/tests/Directory/Regressions.cs:line 53
   at System.IO.Tests.Regressions.FileEnumeratorIsThreadSafe() in /Users/dotnet-bot/j/workspace/dotnet_corefx/master/osx-TGroup_netcoreapp+CGroup_Debug+AGroup_x64+TestOuter_false_prtest/src/System.IO.FileSystem/tests/Directory/Regressions.cs:line 21

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.IOdisabled-testThe test is disabled in source code against the issuehelp wanted[up-for-grabs] Good issue for external contributors

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions