Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.Add_File(format: Gnu) #69474

Closed
VincentBu opened this issue May 18, 2022 · 13 comments · Fixed by #71038
Closed
Assignees
Labels
arch-arm64 area-System.Formats.Tar blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' os-linux Linux OS (any supported distro)
Milestone

Comments

@VincentBu
Copy link
Contributor

Run: runtime-coreclr libraries-jitstress 20220517.1

Failed test:

net7.0-Linux-Release-arm64-CoreCLR_checked-no_tiered_compilation-(Ubuntu.1804.Arm64.Open)Ubuntu.1804.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8-20210531091519-97d8652

- System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.Add_File(format: Gnu)

Error message:

Assert.Equal() Failure
Expected: 2022-05-17T07:50:14.0000000+00:00
Actual:   2022-05-17T07:50:13.0000000+00:00


Stack trace
   at System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.VerifyPlatformSpecificMetadata(String filePath, TarEntry entry) in /_/src/libraries/System.Formats.Tar/tests/TarWriter/TarWriter.WriteEntry.File.Tests.Unix.cs:line 194
   at System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.Add_File(TarFormat format) in /_/src/libraries/System.Formats.Tar/tests/TarWriter/TarWriter.WriteEntry.File.Tests.cs:line 110
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.RuntimeMethodInfo.InvokeNonEmitUnsafe(Object obj, IntPtr* arguments, Span`1 argsForTemporaryMonoSupport, BindingFlags invokeAttr) in /_/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs:line 383

No kusto information.

@VincentBu VincentBu added arch-arm64 os-linux Linux OS (any supported distro) labels May 18, 2022
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label May 18, 2022
@ghost
Copy link

ghost commented May 18, 2022

Tagging subscribers to this area: @dotnet/area-system-io-compression
See info in area-owners.md if you want to be subscribed.

Issue Details

Run: runtime-coreclr libraries-jitstress 20220517.1

Failed test:

net7.0-Linux-Release-arm64-CoreCLR_checked-no_tiered_compilation-(Ubuntu.1804.Arm64.Open)Ubuntu.1804.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8-20210531091519-97d8652

- System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.Add_File(format: Gnu)

Error message:

Assert.Equal() Failure
Expected: 2022-05-17T07:50:14.0000000+00:00
Actual:   2022-05-17T07:50:13.0000000+00:00


Stack trace
   at System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.VerifyPlatformSpecificMetadata(String filePath, TarEntry entry) in /_/src/libraries/System.Formats.Tar/tests/TarWriter/TarWriter.WriteEntry.File.Tests.Unix.cs:line 194
   at System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.Add_File(TarFormat format) in /_/src/libraries/System.Formats.Tar/tests/TarWriter/TarWriter.WriteEntry.File.Tests.cs:line 110
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.RuntimeMethodInfo.InvokeNonEmitUnsafe(Object obj, IntPtr* arguments, Span`1 argsForTemporaryMonoSupport, BindingFlags invokeAttr) in /_/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs:line 383

No kusto information.

Author: VincentBu
Assignees: -
Labels:

arch-arm64, area-System.IO.Compression, os-linux, untriaged

Milestone: -

@ghost
Copy link

ghost commented May 18, 2022

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

Run: runtime-coreclr libraries-jitstress 20220517.1

Failed test:

net7.0-Linux-Release-arm64-CoreCLR_checked-no_tiered_compilation-(Ubuntu.1804.Arm64.Open)Ubuntu.1804.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8-20210531091519-97d8652

- System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.Add_File(format: Gnu)

Error message:

Assert.Equal() Failure
Expected: 2022-05-17T07:50:14.0000000+00:00
Actual:   2022-05-17T07:50:13.0000000+00:00


Stack trace
   at System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.VerifyPlatformSpecificMetadata(String filePath, TarEntry entry) in /_/src/libraries/System.Formats.Tar/tests/TarWriter/TarWriter.WriteEntry.File.Tests.Unix.cs:line 194
   at System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.Add_File(TarFormat format) in /_/src/libraries/System.Formats.Tar/tests/TarWriter/TarWriter.WriteEntry.File.Tests.cs:line 110
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.RuntimeMethodInfo.InvokeNonEmitUnsafe(Object obj, IntPtr* arguments, Span`1 argsForTemporaryMonoSupport, BindingFlags invokeAttr) in /_/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs:line 383

No kusto information.

Author: VincentBu
Assignees: -
Labels:

arch-arm64, area-System.IO, os-linux, untriaged

Milestone: -

@jkotas
Copy link
Member

jkotas commented May 29, 2022

Failed in #69948

This is failing often enough to deserve blocking-clean-ci label.

@jkotas jkotas added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label May 29, 2022
@MichalStrehovsky
Copy link
Member

Also failed in #69838. Different test, but likely the same problem (the seconds are off by one):

Exception Message

Assert.Equal() Failure
Expected: 2022-05-30T03:28:53.0000000+00:00
Actual: 2022-05-30T03:28:52.0000000+00:00

Stack Trace

at System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.VerifyPlatformSpecificMetadata(String filePath, TarEntry entry) in //src/libraries/System.Formats.Tar/tests/TarWriter/TarWriter.WriteEntry.File.Tests.Unix.cs:line 195
at System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.Add_SymbolicLink(TarFormat format, Boolean createTarget) in /
/src/libraries/System.Formats.Tar/tests/TarWriter/TarWriter.WriteEntry.File.Tests.cs:line 207
at InvokeStub_TarWriter_WriteEntry_File_Tests.Add_SymbolicLink(Object, Object, IntPtr*)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

@carlossanlop
Copy link
Member

carlossanlop commented May 31, 2022

The Kusto query tells me this is happening in:

  • PRs only (no rolling builds)
  • Linux only, specifically Ubuntu 18.04 and redhat 7.
  • x64 and arm architectures.
Jobs
| project JobId, Source, Build, Started, Type
| where Started > ago(15d)
| where Type startswith "test/functional/cli/innerloop"
| where Source == "pr/public/dotnet/runtime/refs/heads/main" or Source startswith "pr/public/dotnet/runtime/refs/pull"
| join kind=inner
	(TestResults | project Result, WorkItemId, JobId, WorkItemFriendlyName, Method, StackTrace, WorkItemName) on JobId
| where Result == "Fail"
| where Method == "Add_File"
| where WorkItemFriendlyName == "System.Formats.Tar.Tests"
| where StackTrace has "VerifyPlatformSpecificMetadata"
| join kind=inner 
    (WorkItems | project WorkItemId, QueueName) on WorkItemId

There are 22 hits in the last 30 days.

As Michal mentioned, the test is failing because the timestamp comparison is differing by one second. This is strange, because the archive entry's timestamp that is converted from integer to DateTimeOffset is what is set in the file that the test extracts to disk. Then the test uses very similar logic to read that timestamp from the extracted file directly, and compares it. The number should be the same.

Update: Pushed PR #69997 to disable the test to unblock PRs.

@carlossanlop carlossanlop added this to the 7.0.0 milestone May 31, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label May 31, 2022
@danmoseley danmoseley removed the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Jun 6, 2022
@danmoseley
Copy link
Member

removing label as test was disabled.

@VincentBu
Copy link
Contributor Author

Failed again in: runtime-coreclr libraries-jitstressregs 20220612.1

Failed test:

net7.0-windows-Release-arm64-CoreCLR_checked-jitstressregs4-Windows.10.Arm64v8.Open

- System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.Add_File(format: Gnu)

Error message:

Assert.Equal() Failure
Expected: 50
Actual:   49


Stack trace
   at System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.VerifyTimestamp(DateTime expected, DateTimeOffset actual) in /_/src/libraries/System.Formats.Tar/tests/TarWriter/TarWriter.WriteEntry.File.Tests.Windows.cs:line 76
   at System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.VerifyPlatformSpecificMetadata(String filePath, TarEntry entry) in /_/src/libraries/System.Formats.Tar/tests/TarWriter/TarWriter.WriteEntry.File.Tests.Windows.cs:line 63
   at System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.Add_File(TarEntryFormat format) in /_/src/libraries/System.Formats.Tar/tests/TarWriter/TarWriter.WriteEntry.File.Tests.cs:line 111
   at InvokeStub_TarWriter_WriteEntry_File_Tests.Add_File(Object, Object, IntPtr*)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

@MichalStrehovsky
Copy link
Member

I haven't looked in detail but it looked like whatever we're validating here was roundripped through a floating-point number in the TAR file format - that raises a red flag around precisions and off-by-one roundings. It should be possible to validate this is caused by rounding by roundtripping all possible integer timestamps within one second through the file format and seeing what comes out on the integer side again.

@carlossanlop
Copy link
Member

I haven't looked in detail but it looked like whatever we're validating here was roundripped through a floating-point number in the TAR file format - that raises a red flag around precisions and off-by-one roundings. It should be possible to validate this is caused by rounding by roundtripping all possible integer timestamps within one second through the file format and seeing what comes out on the integer side again.

Thank you, @MichalStrehovsky. I am currently working on changing all the tar tests to avoid expecting exact values. But I will also test what you're suggesting, in case the conversion logic from/to DateTimeOffset/double is wrong.

cc @tannergooding @dakersnar

@tannergooding
Copy link
Member

There may be a bug for certain values, but it is worth noting that guaranteeing roundtripping for long->double->long isn't possible because its by definition a lossy operation for integers over 2^52.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jun 21, 2022
@MichalStrehovsky
Copy link
Member

Another similarly looking failure in System.Formats.Tar.Tests.V7TarEntry_Conversion_Tests.Constructor_ConversionGnu_BackAndForth_SymbolicLink:

    System.Formats.Tar.Tests.V7TarEntry_Conversion_Tests.Constructor_ConversionGnu_BackAndForth_SymbolicLink [FAIL]
      Assert.Equal() Failure
      Expected: 27
      Actual:   28
      Stack Trace:
        /_/src/libraries/System.Formats.Tar/tests/TarTestsBase.cs(311,0): at System.Formats.Tar.Tests.TarTestsBase.CompareDateTimeOffsets(DateTimeOffset expected, DateTimeOffset actual)
        /_/src/libraries/System.Formats.Tar/tests/TarEntry/TarEntry.Conversion.Tests.Base.cs(152,0): at System.Formats.Tar.Tests.TarTestsConversionBase.ConvertAndVerifyEntry(TarEntry originalEntry, TarEntryType entryType, TarEntryFormat formatToConvert, DateTimeOffset initialNow)
        /_/src/libraries/System.Formats.Tar/tests/TarEntry/TarEntry.Conversion.Tests.Base.cs(45,0): at System.Formats.Tar.Tests.TarTestsConversionBase.TestConstructionConversionBackAndForth(TarEntryType originalEntryType, TarEntryFormat firstAndLastFormat, TarEntryFormat formatToConvert)
        /_/src/libraries/System.Formats.Tar/tests/TarEntry/V7TarEntry.Conversion.Tests.cs(218,0): at System.Formats.Tar.Tests.V7TarEntry_Conversion_Tests.Constructor_ConversionGnu_BackAndForth_SymbolicLink()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(69,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.Add_CharacterDevice [SKIP]
      Condition(s) not met: "IsRemoteExecutorSupportedAndOnUnixAndSuperUser"
    System.Formats.Tar.Tests.TarWriter_WriteEntry_File_Tests.Add_Fifo [SKIP]
      Condition(s) not met: "IsRemoteExecutorSupportedAndOnUnixAndSuperUser"
  Finished:    System.Formats.Tar.Tests
=== TEST EXECUTION SUMMARY ===
   System.Formats.Tar.Tests  Total: 440, Errors: 0, Failed: 1, Skipped: 3, Time: 3.042s

There are several tests with this failure mode, but only one of them got disabled. #69997 (comment)

The latest one hit in https://dev.azure.com/dnceng/public/_build/results?buildId=1835642&view=logs&jobId=ee1d0ee6-ff1e-56e7-4a8c-87d1cd9cc235.

I'm putting back blocking clean CI label.

@MichalStrehovsky MichalStrehovsky added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Jun 21, 2022
@VincentBu
Copy link
Contributor Author

Failed again in: runtime-coreclr libraries-jitstress 20220621.1

Failed test:

net7.0-Linux-Release-arm64-CoreCLR_checked-jitstress1-(Ubuntu.1804.Arm64.Open)Ubuntu.1804.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8-20210531091519-97d8652

- System.Formats.Tar.Tests.V7TarEntry_Conversion_Tests.Constructor_ConversionGnu_BackAndForth_SymbolicLink

net7.0-Linux-Release-arm64-CoreCLR_checked-jitstress2-(Ubuntu.1804.Arm64.Open)Ubuntu.1804.Armarch.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-helix-arm64v8-20210531091519-97d8652

- System.Formats.Tar.Tests.V7TarEntry_Conversion_Tests.Constructor_ConversionGnu_BackAndForth_SymbolicLink

Error message:

Assert.Equal() Failure
Expected: 44
Actual:   45


Stack trace
   at System.Formats.Tar.Tests.TarTestsBase.CompareDateTimeOffsets(DateTimeOffset expected, DateTimeOffset actual) in /_/src/libraries/System.Formats.Tar/tests/TarTestsBase.cs:line 311
   at System.Formats.Tar.Tests.TarTestsConversionBase.ConvertAndVerifyEntry(TarEntry originalEntry, TarEntryType entryType, TarEntryFormat formatToConvert, DateTimeOffset initialNow) in /_/src/libraries/System.Formats.Tar/tests/TarEntry/TarEntry.Conversion.Tests.Base.cs:line 152
   at System.Formats.Tar.Tests.TarTestsConversionBase.TestConstructionConversionBackAndForth(TarEntryType originalEntryType, TarEntryFormat firstAndLastFormat, TarEntryFormat formatToConvert) in /_/src/libraries/System.Formats.Tar/tests/TarEntry/TarEntry.Conversion.Tests.Base.cs:line 45
   at System.Formats.Tar.Tests.V7TarEntry_Conversion_Tests.Constructor_ConversionGnu_BackAndForth_SymbolicLink() in /_/src/libraries/System.Formats.Tar/tests/TarEntry/V7TarEntry.Conversion.Tests.cs:line 218
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs:line 64

@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jun 23, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 area-System.Formats.Tar blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' os-linux Linux OS (any supported distro)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants