Skip to content

Creating a tar directly into a GZipStream crashes when writing final records #70172

@carlossanlop

Description

@carlossanlop

The root cause is that we access the position, which is unsupported by GZipStream (unseekable stream).

https://github.com/dotnet/runtime/blame/218a4b1dad3f73eec8f9898761501c4cfa14698e/src/libraries/System.Formats.Tar/src/System/Formats/Tar/TarWriter.cs#L314

The fix would be to detect if the stream is seekable. If it is, then we can set the length to the position. Otherwise, we skip that step.

Thanks @rainersigwald for reporting this.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions