Skip to content

[Bug]: Large file volume compression error issue CMultiVolumeOutStream #279

Description

@ywapple

bit7z version

4.0.x

Compilation options

BIT7Z_AUTO_FORMAT, BIT7Z_PATH_SANITIZATION, BIT7Z_USE_NATIVE_STRING

7-zip version

v23.01

7-zip shared library used

7z.dll / 7z.so

Compilers

MSVC

Compiler versions

vs2022

Architecture

x86

Operating system

Windows

Operating system versions

windows11

Bug description

Scenario: Compressing a folder consisting of a large number of small files (over 15GB in size) into volumes ranging from 20MB to 4481MB will result in the deletion of the first volume package when compressing to the second file
Then it leads to an exception:
void BitOutputArchive::compressOut( ....
{
const HRESULT result = outArc->UpdateItems( outStream, itemsCount(), updateCallback );
//result = HRESULT_FROM_WIN32(ERROR_FILE_EXISTS)
}
If the file I need to compress is relatively small or a single large file (the calculation speed should be fast), I won't have this problem
I found that the principle in CMultiVolumeOutStream during debugging is:

  1. Advance CMultiVolumeOutStream::Write to generate multiple compressed files of 001-0.. and check if there is enough space
    2.CMultiVolumeOutStream:: SetSize and delete the pre generated volume files
  2. Then CMultiVolumeOutStream: Write started compression in progress
    The scenario I described above is that CMultiVolumeOutStream was not called: Write to pre generate a compressed file of volumes
    After compressing the first volume directly, call CMultiVolumeOutStream at. 001: Settize deleted the first volume 001, resulting in an exception failure
    Could you please help me deal with this situation by right clicking on the emergency button? Can you guide me to modify the code there?

Steps to reproduce

No response

Expected behavior

No response

Relevant compilation output

Code of Conduct

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions