InvalidOperationException when extracting RAR - 0.42.0, 0.42.1, 0.43.0 #749

Closed
opened 2026-01-29 22:16:52 +00:00 by claunia · 3 comments
Owner

Originally created by @Camble on GitHub (Jan 3, 2026).

Originally assigned to: @adamhathcock, @Copilot on GitHub.

Extracting RAR files now raise InvalidOperationException

Message:
System.InvalidOperationException : unpacked file size does not match header: expected 22369776 found 31148016

Stack Trace:
RarStream.ReadImplAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
RarStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
Stream.g__Core|27_0(Stream source, Stream destination, Int32 bufferSize, CancellationToken cancellationToken)

Originally created by @Camble on GitHub (Jan 3, 2026). Originally assigned to: @adamhathcock, @Copilot on GitHub. Extracting RAR files now raise InvalidOperationException **Message:**  System.InvalidOperationException : unpacked file size does not match header: expected 22369776 found 31148016 **Stack Trace:**  RarStream.ReadImplAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) RarStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken) Stream.<CopyToAsync>g__Core|27_0(Stream source, Stream destination, Int32 bufferSize, CancellationToken cancellationToken)
claunia added the bug label 2026-01-29 22:16:52 +00:00
Author
Owner

@adamhathcock commented on GitHub (Jan 4, 2026):

I assume this worked with versions earlier than 0.42.0?

What OS and can you give me a sample file?

@adamhathcock commented on GitHub (Jan 4, 2026): I assume this worked with versions earlier than 0.42.0? What OS and can you give me a sample file?
Author
Owner

@adamhathcock commented on GitHub (Jan 4, 2026):

Try https://www.nuget.org/packages/SharpCompress/0.44.0-beta.13

@adamhathcock commented on GitHub (Jan 4, 2026): Try https://www.nuget.org/packages/SharpCompress/0.44.0-beta.13
Author
Owner

@Camble commented on GitHub (Jan 4, 2026):

That works, thanks.

@Camble commented on GitHub (Jan 4, 2026): That works, thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#749