-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] TPacker.Do7zip: Command-line length limitation in Windows #1890
Comments
Hmm. fmd.exe could not be started. Application error 0xc000007b. |
I changed FMD2 completely to 64bit for testing. Your solution is working. But it is a little bit of a hack :-) For example the dynamic creation and deletion of the temp folder for each run in the program folder. While functional, this approach has notable issues:
In my case the FMD2 program folder is stored on a network share with snaphots on -> lots of clutter here. You address path length issues by truncating paths or prepending the \?\ prefix to enable long path support. While this works, there are concerns. Simply cutting off paths at MAX_PATHDIR risks data loss and file mismanagement. More elegant solution: Validate the path's length and provide meaningful feedback or alternative handling for overly long paths.
But now the most important thing: |
Now that you use 64bit. Does memory problems still happen? Thanks for the feedback. I'll let the person who made the change know when they're available. |
I bet 'yes'. See attached screenshot. Shows 45min runtime loading 150 download tasks with approx. 50 chapters each slowly. 45.000 tasks in the "all" list. Memoy consumption increased in time of no active data transfer too (see beginning of graph with no network io activity). Just a guess: might be GC from lua and memory fragmentation? Mem-start is around 700MB, end is 1.7GB and still 70 download tasks to go. |
I've compiled 32bit version. Could you test it too? |
(Perhaps we should transfer this to a new issue?) |
32bit version is not working at all (new parameter "long path names" is enabled)
|
You can create a new issue regarding memory problems.
Glad it is not released yet. I don't test much with 32bit version. Do you now Pascal? There's FMD discord server if you want to join. |
Prerequisites
System information
Windows 11 all versions
Describe the bug
When a command-line command in Windows exceeds a certain length, it fails to execute. This issue occurs in the application FMD2, specifically within the TPacker.Do7zip method, which invokes the 7za.exe executable to compress multiple files into a single .cbz archive.
To Reproduce
When attempting to process several hundred image files, the application throws the following error:
ERROR: TPacker.Do7zip Error: Unknown \\...\fmd2\...\7za.exe a -tzip -mx0 -mmt20 -sccUTF-8 -scsUTF-8 -stl -spd -slt -sse -sdel "<lots of files> <lots of files> <...>"
The error occurs consistently when the command-line string exceeds a certain length, specifically when a large number of file paths are passed to the 7za.exe executable. This indicates that the command-line length limit in Windows is being exceeded.
A typical source for reproduction is "+99 Reinforced Wooden Stick," which has chapters that can contain more than 350 files.
Expected behavior
To resolve this limitation, the implementation of TPacker.Do7zip in FMD2 should be adjusted. A recommended approach could be:
7za.exe a -tzip -mx0 -mmt20 -sccUTF-8 -scsUTF-8 -stl -spd -slt -sse -sdel "@filelist.txt" output.cbz
Alternative Approaches
Screenshots
No response
Additional context
The maximum command-line length in Windows is known to be limited to approximately 32,768 characters. When this limit is surpassed, the operating system is unable to process the command, resulting in execution failure.
The text was updated successfully, but these errors were encountered: