Skip to content

TarReader unable to parse header attribute number of archive generated in iOS #103734

Closed

Description

@carlossanlop

The runfo tool fails to read some tar files with the exception shown below.
The jobID and workItem used are from a CI leg for iOS: job | log

The runfo tool is currently targeting net7.0 so I thought the tar bug was in that version. But I cloned the project, bumped the TargetFramework to net8.0, rebuilt, ran the command using the updated version, and I am still seeing the issue.

I'll share more details after I crack open the file.

runfo get-helix-payload --output=~/repos/helix/ --jobid=43c9e938-fc87-44bb-9596-74e8132ac106 --workitems=fbe6f019-aecc-43f1-880e-3a18d7079d7b
...
...
Payload cmake-3.28.0-macos-universal.tar.gz => /Users/carlos/repos/helix/~/repos/helix/correlation-payload/cmake-3.28.0-macos-universal.tar.gz
Unable to parse number.       
   at System.Formats.Tar.TarHelpers.ThrowInvalidNumber()
   at System.Formats.Tar.TarHelpers.ParseOctal[T](ReadOnlySpan`1 buffer)
   at System.Formats.Tar.TarHeader.TryReadCommonAttributes(Span`1 buffer, TarEntryFormat initialFormat)
   at System.Formats.Tar.TarHeader.TryReadAttributes(TarEntryFormat initialFormat, Span`1 buffer)
   at System.Formats.Tar.TarHeader.TryGetNextHeader(Stream archiveStream, Boolean copyData, TarEntryFormat initialFormat, Boolean processDataBlock)
   at System.Formats.Tar.TarReader.TryProcessExtendedAttributesHeader(TarHeader extendedAttributesHeader, Boolean copyData, TarHeader& actualHeader)
   at System.Formats.Tar.TarReader.TryGetNextEntryHeader(Boolean copyData)
   at System.Formats.Tar.TarReader.GetNextEntry(Boolean copyData)
   at System.Formats.Tar.TarFile.ExtractToDirectoryInternal(Stream source, String destinationDirectoryPath, Boolean overwriteFiles, Boolean leaveOpen)
   at DevOps.Util.HelixServer.<>c__DisplayClass9_0.<<GetHelixPayloads>g__DownloadAndExtractFile|0>d.MoveNext() in /home/runner/work/runfo/runfo/DevOps.Util/HelixServer.cs:line 164
--- End of stack trace from previous location ---
   at DevOps.Util.HelixServer.GetHelixPayloads(String jobId, List`1 workItems, String downloadDir, Boolean ignoreDumps, Boolean resume, Boolean extract) in /home/runner/work/runfo/runfo/DevOps.Util/HelixServer.cs:line 94
   at Runfo.RuntimeInfo.GetHelixPayload(IEnumerable`1 args) in /home/runner/work/runfo/runfo/runfo/RuntimeInfo.cs:line 1125
   at Runfo.Program.<>c__DisplayClass0_0.<<Main>g__RunCommand|0>d.MoveNext() in /home/runner/work/runfo/runfo/runfo/Program.cs:line 91
--- End of stack trace from previous location ---
   at Runfo.Program.Main(String[] args) in /home/runner/work/runfo/runfo/runfo/Program.cs:line 54
   at Runfo.Program.Main(String[] args) in /home/runner/work/runfo/runfo/runfo/Program.cs:line 58

Activity

  1. dotnet-policy-service commented on Jun 19, 2024

    @dotnet-policy-service
    Contributor

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

  2. tmds commented on Jun 20, 2024

    @tmds
    Member

    From the stacktrace it looks probable that #101172 will fix this.

  3. jeffhandley commented on Jul 20, 2024

    @jeffhandley
    Member

    @tmds or @carlossanlop -- Do we know if #101172 addressed this yet?

  4. added
    needs-further-triageIssue has been initially triaged, but needs deeper consideration or reconsideration
    and removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 20, 2024
  5. added this to the Future milestone on Jul 20, 2024
  6. carlossanlop commented on Jul 22, 2024

    @carlossanlop
    ContributorAuthor

    I was able to repro the problem in .NET 8.0 by downloading the problem file directly and trying to open it using GZipStream + TarFile.ExtractToDirectory: https://netcorenativeassets.blob.core.windows.net/resource-packages/external/macos/cmake/cmake-3.28.0-macos-universal.tar.gz

    I was also able to confirm that the problem is gone with the latest bits in main, @tmds PR fixed it.

    The fix was merged to main on June 25th, but the Preview6 snap happened on June 19th, so this should be fixed in Preview7.

  7. locked and limited conversation to collaborators on Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions