Skip to content

Failing TarFile_ExtractToDirectory tests in release/8.0 and release/9.0 #129227

Description

@svick

In #129195 and #129194, some TarFile_ExtractToDirectory tests are failing (most only on macOS, but one also on Windows). I am going to disable them so that the PRs can be merged, but the issues should still be resolved.

cc: @alinpahontu2912

Specifically, on release/8.0:

❌ System.Formats.Tar.Tests.TarFile_ExtractToDirectory_File_Tests.ExtractArchiveWithEntriesThatStartWithSlashDotPrefix
Failing Configurations (3)
net8.0-osx-Debug-x64-Mono_release-OSX.14.Amd64.Open
net8.0-osx-Debug-x64-CoreCLR_checked-OSX.14.Amd64.Open
net8.0-osx-Debug-x64-CoreCLR_release-OSX.14.Amd64.Open
Exception Message
System.ArgumentOutOfRangeException : startIndex cannot be larger than length of string. (Parameter 'startIndex')
CallStack
at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length) in /_/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs:line 2088
at System.String.Substring(Int32 startIndex) in /_/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs:line 2044
at System.Formats.Tar.TarEntry.FilePathEscapesDirectory(String destinationDirectoryPath, String fileDestinationPath) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 405
at System.Formats.Tar.TarEntry.GetDestinationAndLinkPaths(String destinationDirectoryPath) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 340
at System.Formats.Tar.TarEntry.ExtractRelativeToDirectory(String destinationDirectoryPath, Boolean overwrite, SortedDictionary`2 pendingModes, Stack`1 directoryModificationTimes) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 290
at System.Formats.Tar.TarFile.ExtractToDirectoryInternal(Stream source, String destinationDirectoryFullPath, Boolean overwriteFiles, Boolean leaveOpen) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs:line 467
at System.Formats.Tar.TarFile.ExtractToDirectory(Stream source, String destinationDirectoryName, Boolean overwriteFiles) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs:line 190
at System.Formats.Tar.Tests.TarFile_ExtractToDirectory_File_Tests.ExtractArchiveWithEntriesThatStartWithSlashDotPrefix() in /_/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.File.Tests.cs:line 218
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs:line 22
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57
❌ System.Formats.Tar.Tests.TarFile_ExtractToDirectory_File_Tests.ExtractToDirectory_RejectsChainedSymlinkDirectoryTraversal_WithNestedFile
Failing Configurations (5)
net8.0-osx-Debug-x64-Mono_release-OSX.14.Amd64.Open
net8.0-osx-Debug-x64-CoreCLR_checked-OSX.14.Amd64.Open
net8.0-osx-Debug-x64-CoreCLR_release-OSX.14.Amd64.Open
net8.0-windows-Debug-x86-CoreCLR_checked-Windows.10.Amd64.Open
net8.0-windows-Release-x64-CoreCLR_checked-Windows.10.Amd64.Open
Exception Message
Assert.Throws() Failure
Expected: typeof(System.IO.IOException)
Actual: typeof(System.ArgumentOutOfRangeException): startIndex cannot be larger than length of string. (Parameter 'startIndex')
---- System.ArgumentOutOfRangeException : startIndex cannot be larger than length of string. (Parameter 'startIndex')
CallStack
at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length) in /_/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs:line 2088
at System.String.Substring(Int32 startIndex) in /_/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs:line 2044
at System.Formats.Tar.TarEntry.FilePathEscapesDirectory(String destinationDirectoryPath, String fileDestinationPath) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 405
at System.Formats.Tar.TarEntry.GetDestinationAndLinkPaths(String destinationDirectoryPath) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 340
at System.Formats.Tar.TarEntry.ExtractRelativeToDirectory(String destinationDirectoryPath, Boolean overwrite, SortedDictionary`2 pendingModes, Stack`1 directoryModificationTimes) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 290
at System.Formats.Tar.TarFile.ExtractToDirectoryInternal(Stream source, String destinationDirectoryFullPath, Boolean overwriteFiles, Boolean leaveOpen) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs:line 467
at System.Formats.Tar.TarFile.ExtractToDirectory(String sourceFileName, String destinationDirectoryName, Boolean overwriteFiles) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs:line 276
at System.Formats.Tar.Tests.TarFile_ExtractToDirectory_File_Tests.<>c__DisplayClass14_0.<ExtractToDirectory_RejectsChainedSymlinkDirectoryTraversal_WithNestedFile>b__1() in /_/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.File.Tests.cs:line 453
----- Inner Stack Trace -----
at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length) in /_/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs:line 2088
at System.String.Substring(Int32 startIndex) in /_/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs:line 2044
at System.Formats.Tar.TarEntry.FilePathEscapesDirectory(String destinationDirectoryPath, String fileDestinationPath) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 405
at System.Formats.Tar.TarEntry.GetDestinationAndLinkPaths(String destinationDirectoryPath) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 340
at System.Formats.Tar.TarEntry.ExtractRelativeToDirectory(String destinationDirectoryPath, Boolean overwrite, SortedDictionary`2 pendingModes, Stack`1 directoryModificationTimes) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 290
at System.Formats.Tar.TarFile.ExtractToDirectoryInternal(Stream source, String destinationDirectoryFullPath, Boolean overwriteFiles, Boolean leaveOpen) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs:line 467
at System.Formats.Tar.TarFile.ExtractToDirectory(String sourceFileName, String destinationDirectoryName, Boolean overwriteFiles) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs:line 276
at System.Formats.Tar.Tests.TarFile_ExtractToDirectory_File_Tests.<>c__DisplayClass14_0.<ExtractToDirectory_RejectsChainedSymlinkDirectoryTraversal_WithNestedFile>b__1() in /_/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.File.Tests.cs:line 453

And on release/9.0:

❌ System.Formats.Tar.Tests.TarFile_ExtractToDirectory_File_Tests.ExtractArchiveWithEntriesThatStartWithSlashDotPrefix
Failing Configurations (3)
net9.0-osx-Debug-x64-Mono_Minijit_Debug-OSX.15.Amd64.Open
net9.0-osx-Debug-x64-coreclr_release-OSX.15.Amd64.Open
net9.0-osx-Debug-x64-coreclr_checked-OSX.15.Amd64.Open
Exception Message
System.ArgumentOutOfRangeException : startIndex cannot be larger than length of string. (Parameter 'startIndex')
CallStack
at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length) in /_/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs:line 2279
at System.String.Substring(Int32 startIndex) in /_/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs:line 2235
at System.Formats.Tar.TarEntry.FilePathEscapesDirectory(String destinationDirectoryPath, String fileDestinationPath) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 420
at System.Formats.Tar.TarEntry.GetDestinationAndLinkPaths(String destinationDirectoryPath) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 355
at System.Formats.Tar.TarEntry.ExtractRelativeToDirectory(String destinationDirectoryPath, Boolean overwrite, SortedDictionary`2 pendingModes, Stack`1 directoryModificationTimes) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 305
at System.Formats.Tar.TarFile.ExtractToDirectoryInternal(Stream source, String destinationDirectoryFullPath, Boolean overwriteFiles, Boolean leaveOpen) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs:line 467
at System.Formats.Tar.TarFile.ExtractToDirectory(Stream source, String destinationDirectoryName, Boolean overwriteFiles) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs:line 190
at System.Formats.Tar.Tests.TarFile_ExtractToDirectory_File_Tests.ExtractArchiveWithEntriesThatStartWithSlashDotPrefix() in /_/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.File.Tests.cs:line 218
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs:line 22
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57
❌ System.Formats.Tar.Tests.TarFile_ExtractToDirectory_File_Tests.ExtractToDirectory_RejectsChainedSymlinkDirectoryTraversal_WithNestedFile
Failing Configurations (5)
net9.0-osx-Debug-x64-Mono_Minijit_Debug-OSX.15.Amd64.Open
net9.0-osx-Debug-x64-coreclr_release-OSX.15.Amd64.Open
net9.0-osx-Debug-x64-coreclr_checked-OSX.15.Amd64.Open
net9.0-windows-Debug-x86-coreclr_checked-Windows.10.Amd64.Open
net9.0-windows-Release-x64-coreclr_checked-Windows.10.Amd64.Open
Exception Message
Assert.Throws() Failure: Exception type was not an exact match
Expected: typeof(System.IO.IOException)
Actual: typeof(System.ArgumentOutOfRangeException)
---- System.ArgumentOutOfRangeException : startIndex cannot be larger than length of string. (Parameter 'startIndex')
CallStack
at System.Formats.Tar.Tests.TarFile_ExtractToDirectory_File_Tests.ExtractToDirectory_RejectsChainedSymlinkDirectoryTraversal_WithNestedFile() in /_/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.File.Tests.cs:line 453
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs:line 22
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57
----- Inner Stack Trace -----
at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length) in /_/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs:line 2279
at System.String.Substring(Int32 startIndex) in /_/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs:line 2235
at System.Formats.Tar.TarEntry.FilePathEscapesDirectory(String destinationDirectoryPath, String fileDestinationPath) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 420
at System.Formats.Tar.TarEntry.GetDestinationAndLinkPaths(String destinationDirectoryPath) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 355
at System.Formats.Tar.TarEntry.ExtractRelativeToDirectory(String destinationDirectoryPath, Boolean overwrite, SortedDictionary`2 pendingModes, Stack`1 directoryModificationTimes) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 305
at System.Formats.Tar.TarFile.ExtractToDirectoryInternal(Stream source, String destinationDirectoryFullPath, Boolean overwriteFiles, Boolean leaveOpen) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs:line 467
at System.Formats.Tar.TarFile.ExtractToDirectory(String sourceFileName, String destinationDirectoryName, Boolean overwriteFiles) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs:line 276
at System.Formats.Tar.Tests.TarFile_ExtractToDirectory_File_Tests.<>c__DisplayClass14_0.<ExtractToDirectory_RejectsChainedSymlinkDirectoryTraversal_WithNestedFile>b__1() in /_/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.File.Tests.cs:line 453
❌ System.Formats.Tar.Tests.TarFile_ExtractToDirectory_File_Tests.ExtractToDirectory_RejectsSymlinkDirectoryTraversal_WithNestedFile
Failing Configurations (3)
net9.0-osx-Debug-x64-Mono_Minijit_Debug-OSX.15.Amd64.Open
net9.0-osx-Debug-x64-coreclr_release-OSX.15.Amd64.Open
net9.0-osx-Debug-x64-coreclr_checked-OSX.15.Amd64.Open
Exception Message
Assert.Throws() Failure: Exception type was not an exact match
Expected: typeof(System.IO.IOException)
Actual: typeof(System.ArgumentOutOfRangeException)
---- System.ArgumentOutOfRangeException : startIndex cannot be larger than length of string. (Parameter 'startIndex')
CallStack
at System.Formats.Tar.Tests.TarFile_ExtractToDirectory_File_Tests.ExtractToDirectory_RejectsSymlinkDirectoryTraversal_WithNestedFile() in /_/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.File.Tests.cs:line 404
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs:line 22
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57
----- Inner Stack Trace -----
at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length) in /_/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs:line 2279
at System.String.Substring(Int32 startIndex) in /_/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs:line 2235
at System.Formats.Tar.TarEntry.FilePathEscapesDirectory(String destinationDirectoryPath, String fileDestinationPath) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 420
at System.Formats.Tar.TarEntry.GetDestinationAndLinkPaths(String destinationDirectoryPath) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 355
at System.Formats.Tar.TarEntry.ExtractRelativeToDirectory(String destinationDirectoryPath, Boolean overwrite, SortedDictionary`2 pendingModes, Stack`1 directoryModificationTimes) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarEntry.cs:line 305
at System.Formats.Tar.TarFile.ExtractToDirectoryInternal(Stream source, String destinationDirectoryFullPath, Boolean overwriteFiles, Boolean leaveOpen) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs:line 467
at System.Formats.Tar.TarFile.ExtractToDirectory(String sourceFileName, String destinationDirectoryName, Boolean overwriteFiles) in /_/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarFile.cs:line 276
at System.Formats.Tar.Tests.TarFile_ExtractToDirectory_File_Tests.<>c__DisplayClass13_0.<ExtractToDirectory_RejectsSymlinkDirectoryTraversal_WithNestedFile>b__0() in /_/src/libraries/System.Formats.Tar/tests/TarFile/TarFile.ExtractToDirectory.File.Tests.cs:line 404

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions