7-zip 23.01 #573

Open
opened 2026-01-29 22:13:56 +00:00 by claunia · 4 comments
Owner

Originally created by @Quetzalcoatl2435 on GitHub (Jul 8, 2023).

I've recently updated 7-zip to v23.01 and files compressed with it can be extracted properly on linux-x64, but fails on linux-arm (e.g. Raspberry Pi) with unsupported method error message.

Reverted back to 7-zip v22.01 and everything works properly again.

Not a very big deal, but would be nice to get 7-zip 23.01 support, 'cause every other lib I've tried only supports Windows, so this library is really a life saver.

Thanks!

Originally created by @Quetzalcoatl2435 on GitHub (Jul 8, 2023). I've recently updated 7-zip to v23.01 and files compressed with it can be extracted properly on linux-x64, but fails on linux-arm (e.g. Raspberry Pi) with unsupported method error message. Reverted back to 7-zip v22.01 and everything works properly again. Not a very big deal, but would be nice to get 7-zip 23.01 support, 'cause every other lib I've tried only supports Windows, so this library is really a life saver. Thanks!
claunia added the bugup for grabs labels 2026-01-29 22:13:57 +00:00
Author
Owner

@adamhathcock commented on GitHub (Jul 10, 2023):

Please give me a stacktrace. ARM isn't somehing I explicity test.

@adamhathcock commented on GitHub (Jul 10, 2023): Please give me a stacktrace. ARM isn't somehing I explicity test.
Author
Owner

@Quetzalcoatl2435 commented on GitHub (Jul 10, 2023):

Specified method is not supported.
   at SharpCompress.Compressors.LZMA.DecoderRegistry.CreateDecoderStream(CMethodId , Stream[] , Byte[] , IPasswordProvider , Int64 )
   at SharpCompress.Compressors.LZMA.DecoderStreamHelper.CreateDecoderStream(Stream[] , Int64[] , Stream[] , CFolder , Int32 , IPasswordProvider )
   at SharpCompress.Compressors.LZMA.DecoderStreamHelper.CreateDecoderStream(Stream , Int64 , Int64[] , CFolder , IPasswordProvider )
   at SharpCompress.Common.SevenZip.ArchiveDatabase.GetFolderStream(Stream , CFolder , IPasswordProvider )
   at SharpCompress.Common.SevenZip.SevenZipFilePart.GetCompressedStream()
   at SharpCompress.Archives.SevenZip.SevenZipArchiveEntry.OpenEntryStream()
   at SharpCompress.Archives.IArchiveEntryExtensions.WriteTo(IArchiveEntry , Stream )
   at SharpCompress.Archives.IArchiveEntryExtensions.<>c__DisplayClass2_0.<WriteToFile>b__0(String , FileMode )
   at SharpCompress.Common.ExtractionMethods.WriteEntryToFile(IEntry , String , ExtractionOptions , Action`2 )
   at SharpCompress.Archives.IArchiveEntryExtensions.WriteToFile(IArchiveEntry , String , ExtractionOptions )
   at SharpCompress.Common.ExtractionMethods.WriteEntryToDirectory(IEntry , String , ExtractionOptions , Action`2 )
   at Program.<Main>$(String[] args)
@Quetzalcoatl2435 commented on GitHub (Jul 10, 2023): ``` Specified method is not supported. at SharpCompress.Compressors.LZMA.DecoderRegistry.CreateDecoderStream(CMethodId , Stream[] , Byte[] , IPasswordProvider , Int64 ) at SharpCompress.Compressors.LZMA.DecoderStreamHelper.CreateDecoderStream(Stream[] , Int64[] , Stream[] , CFolder , Int32 , IPasswordProvider ) at SharpCompress.Compressors.LZMA.DecoderStreamHelper.CreateDecoderStream(Stream , Int64 , Int64[] , CFolder , IPasswordProvider ) at SharpCompress.Common.SevenZip.ArchiveDatabase.GetFolderStream(Stream , CFolder , IPasswordProvider ) at SharpCompress.Common.SevenZip.SevenZipFilePart.GetCompressedStream() at SharpCompress.Archives.SevenZip.SevenZipArchiveEntry.OpenEntryStream() at SharpCompress.Archives.IArchiveEntryExtensions.WriteTo(IArchiveEntry , Stream ) at SharpCompress.Archives.IArchiveEntryExtensions.<>c__DisplayClass2_0.<WriteToFile>b__0(String , FileMode ) at SharpCompress.Common.ExtractionMethods.WriteEntryToFile(IEntry , String , ExtractionOptions , Action`2 ) at SharpCompress.Archives.IArchiveEntryExtensions.WriteToFile(IArchiveEntry , String , ExtractionOptions ) at SharpCompress.Common.ExtractionMethods.WriteEntryToDirectory(IEntry , String , ExtractionOptions , Action`2 ) at Program.<Main>$(String[] args) ```
Author
Owner

@adamhathcock commented on GitHub (Jul 10, 2023):

There must be a decoder stream ID we don't have any code for that's being used here.

I would debug and see what's different. Not sure why the older works as there was additive changes in the registry but nothing ARM specific

@adamhathcock commented on GitHub (Jul 10, 2023): There must be a decoder stream ID we don't have any code for that's being used here. I would debug and see what's different. Not sure why the older works as there was additive changes in the registry but nothing ARM specific
Author
Owner

@Quetzalcoatl2435 commented on GitHub (Jul 11, 2023):

Did some more testing and now I get the same error in linux-x64. I didn't catch it before because I tested different files on x64/ARM. This time I tested the same files and got the same error. Weird thing is that it works for some files and not for others. Same compression settings for all files. The only difference I can see so far between the files where extraction fails/succeeds is size. Files < 10 MB fail, files > 10 MB are OK.

using SharpCompress.Archives;
using SharpCompress.Archives.SevenZip;
using SharpCompress.Common;

try
{
    if (args.Length == 0)
    {
        Console.WriteLine("No file specified.");
        return;
    }

    Console.WriteLine("Extracting archive...");
    using var archive = SevenZipArchive.Open(args[0]);
    foreach (var entry in archive.Entries.Where(entry => !entry.IsDirectory))
    {
        Console.WriteLine(entry.Key);
        entry.WriteToDirectory(".", new ExtractionOptions()
        {
            ExtractFullPath = true,
            Overwrite = true,
            PreserveFileTime = true
        });
    }
    Console.WriteLine("Done!");
}
catch (Exception ex)
{
    File.AppendAllText("Debug.log", ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine);
}

Test files:
Test.zip

Results:
libHarfBuzzSharp.7z -> exception
libmongocrypt.7z -> OK
libSkiaSharp.7z -> exception
libSystem.IO.Ports.Native.7z -> exception

@Quetzalcoatl2435 commented on GitHub (Jul 11, 2023): Did some more testing and now I get the same error in linux-x64. I didn't catch it before because I tested different files on x64/ARM. This time I tested the same files and got the same error. Weird thing is that it works for some files and not for others. Same compression settings for all files. The only difference I can see so far between the files where extraction fails/succeeds is size. Files < 10 MB fail, files > 10 MB are OK. ``` using SharpCompress.Archives; using SharpCompress.Archives.SevenZip; using SharpCompress.Common; try { if (args.Length == 0) { Console.WriteLine("No file specified."); return; } Console.WriteLine("Extracting archive..."); using var archive = SevenZipArchive.Open(args[0]); foreach (var entry in archive.Entries.Where(entry => !entry.IsDirectory)) { Console.WriteLine(entry.Key); entry.WriteToDirectory(".", new ExtractionOptions() { ExtractFullPath = true, Overwrite = true, PreserveFileTime = true }); } Console.WriteLine("Done!"); } catch (Exception ex) { File.AppendAllText("Debug.log", ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine); } ``` Test files: [Test.zip](https://github.com/adamhathcock/sharpcompress/files/12009539/Test.zip) Results: libHarfBuzzSharp.7z -> exception libmongocrypt.7z -> OK libSkiaSharp.7z -> exception libSystem.IO.Ports.Native.7z -> exception
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#573