Giter VIP home page Giter VIP logo

Comments (8)

rikyoz avatar rikyoz commented on June 12, 2024

Hi!
Could you provide some sample code to replicate the issues you described?

If compressed memory variables are used for decompression, the directory where the program is located will be opened, causing an exception in the fs object

If I understand correctly, are you extracting an archive from a memory buffer to the filesystem?

If decompressing compressed packages in the fat32 or exfat file system can also cause fs object exceptions

Just to make sure I understood correctly: you're extracting archives to fat32 and exFAT filesystems, right? What archive format are you trying to extract?

Our project's development environment is VS2017 and C++17, which may encounter the above issues. After our testing, using VS2019 or later versions and C++17 will not cause such problems.

This makes me think that it might be some bug in the std::filesystem implementation of VS2017, as bit7z internally uses it for things like paths.
But I'll need more information to understand the cause of the issue.
Thank you for any further info you can provide!

from bit7z.

psvajaz avatar psvajaz commented on June 12, 2024
  1. When decompressing from stream to stream, fs will be used to open the directory where the current executing program is located (i.e.‘./’). If the current executing program is stored in the FAT32 or exFAT file system, an exception will occur

  2. If the compressed file to be decompressed exists in the FAT32 or exFAT file system, or if it needs to be decompressed to FAT32 or exFAT, an fs exception will occur

The above error triggering condition is VS2017 C++17. If the development changes the environment to VS2019 or higher, this issue will not occur

from bit7z.

rikyoz avatar rikyoz commented on June 12, 2024

Thanks for the further details!
I was able to replicate the issue; I'm working on a fix.
Implementing it might take some time, as it will likely require a bit of refactoring, but I'll release it as soon as possible!

from bit7z.

rikyoz avatar rikyoz commented on June 12, 2024

Hi @psvajaz! Yesterday, I pushed a commit to the hotfix/v4.0.5 branch that should fix the issue.
If you can test it, it would really be helpful!
Thank you in advance!

from bit7z.

psvajaz avatar psvajaz commented on June 12, 2024

@rikyoz
After testing:

  1. Compressed packages saved in FAT32 or exFAT file systems can be decompressed to NTFS, FAT32, and exFAT file systems as usual.

  2. Can compress and output regular files in NTFS to FAT32 and exFAT file systems

  3. The compressed file cannot be loaded properly in the file system of FAT32 or exFAT, causing the compression process to fail. The specific compression error location is shown in the following figure:
    fsitem.cpp
    image

from bit7z.

rikyoz avatar rikyoz commented on June 12, 2024

Ok, so the fix was only partial. Thanks for the further tests!

The compressed file cannot be loaded properly in the file system of FAT32 or exFAT, causing the compression process to fail. The specific compression error location is shown in the following figure:
fsitem.cpp

Unfortunately, it seems to be a bug in old versions of MSVC (microsoft/STL#233).

I'm working on finding a possible workaround.

from bit7z.

rikyoz avatar rikyoz commented on June 12, 2024

@psvajaz
I just pushed a commit to the branch hotfix/v4.0.5 with a workaround for the bug.

Now, you can pass the BIT7Z_DISABLE_USE_STD_FILESYSTEM option when configuring bit7z.
This will force the library to always use the ghc::filesystem library instead of the std::filesystem provided by the compiler.

From my tests, this library doesn't suffer from the same bug as MSVC's std::filesystem and seems to fix the issue.

Please let me know if this works for you, too!

from bit7z.

psvajaz avatar psvajaz commented on June 12, 2024

After extensive testing, the bug has been fixed. thanks

from bit7z.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.