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

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

Closed
carlossanlop opened this issue Jun 19, 2024 · 4 comments
Closed
Labels
area-System.Formats.Tar needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration
Milestone

Comments

@carlossanlop
Copy link
Member

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
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jun 19, 2024
Copy link
Contributor

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

@tmds
Copy link
Member

tmds commented Jun 20, 2024

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

@jeffhandley
Copy link
Member

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

@jeffhandley jeffhandley added needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration and removed untriaged New issue has not been triaged by the area owner labels Jul 20, 2024
@jeffhandley jeffhandley added this to the Future milestone Jul 20, 2024
@carlossanlop
Copy link
Member Author

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.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Formats.Tar needs-further-triage Issue has been initially triaged, but needs deeper consideration or reconsideration
Projects
None yet
Development

No branches or pull requests

3 participants