Archive: Compiler Error with Dictionary Size > 149 MB


Compiler Error with Dictionary Size > 149 MB
Hi!

I noticed that makensis.exe fails to compile my script when I use LZMA compression with 150 MB dictionary size or even more. I get an "internal compiler error" and "failed to create uninstaller". Using 149 MB dictionary size seems to be the highest value that works. Is that an expected behavior or a bug?

Cheeeeeeeeers
MuldeR


Here is a log file that shows the problem:

MakeNSIS v2.37 - Copyright 1995-2008 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.

...

Processing script file: "Installer.nsi"

...

SetCompressor: /SOLID LZMA
SetCompressorDictSize: 150 mb

...

Generating uninstaller... Internal compiler error #12345:
deflateInit() failed(initialization failed [-2]).

Note: you may have one or two (large) stale temporary file(s)
left in your temporary directory (Generally this only happens on Windows 9x).
!system: returned 1, aborting
Error in script "D:\MPUI\!_Build.nsi" on line 41 -- aborting creation process


Sorry for double posting, time limit to edit initial post was over :confused:

That large of a dictionary requires over 1.5GB of free memory. Do you have enough?


4 GB of physical RAM plus 4 GB swap file should be enough ;)

I often use 7-Zip with LZMA mode and 256 MB of dictionary (occupies ~3,7 GB of RAM) and I'd like to do the same with NSIS...

Did anybody manage to compile an installer with 150+ MB dictionary size yet?


I noticed that the maximum dictionary size depends on the contents of the installer! I changed my installer quite a bit and now makensis suddenly fails (reproducible) with 149 MB dictionary size. Had to lower it to 144 MB to make my script compile again. Also makensis simply crashes when I use the !packhdr command to call UPX. Not using UPX plus successively lowering the dictionary size seems to workaround the compilation error...


Sorry for posting again, but was anybody able to reproduce this problem? I think it's a bug in makensis and it should be addressed. It's not only that I have to lower the dictionary size (and waste some compression ratio), I even can't use UPX (or UPack) any more...

If some more info is needed, please tell me what to do...


UPX works fine for me.

As for the dictionary, I only have 1.5GB of memory so I can't test it. I can say it fails at the right place - calling VirtualAlloc.


Originally posted by kichik
UPX works fine for me.
It usually does work here too. But this pretty big/complex installer (the same that encounters the compiler error with dictionary size) definitely fails to compile as soon as I use !packhdr command.

Originally posted by kichik As for the dictionary, I only have 1.5GB of memory so I can't test it. I can say it fails at the right place - calling VirtualAlloc. [/B]
I can assure you that I have 4 GB of RAM available and the physical RAM definitely isn't out of memory. And even if so, I'd still have enough Swap File size on my HDD. Furthermore I use 7-Zip, which is the reference implementation of LZMA, quite often. And I use LZMA with 256 MB dictionary size to compress my HDD backups. That is much(!) more data than the installer has to handle, but it never failed. So I'm pretty sure that this error cannot be explained with "out of memory" error...

There's more to it than the number of RAM chips you have. As far as I can tell from the source code, you need 1.5GB of contiguous memory. That's on top of whatever you need for the other file handling of NSIS. On a 32-bit system, that's a heavy requirement. Edit BigAlloc in Source\7zip\Common\Alloc.cpp and see if it really fails there or somewhere else.

As for UPX, I need details as it works fine for me.


Originally posted by kichik
There's more to it than the number of RAM chips you have. As far as I can tell from the source code, you need 1.5GB of contiguous memory. That's on top of whatever you need for the other file handling of NSIS. On a 32-bit system, that's a heavy requirement. Edit BigAlloc in Source\7zip\Common\Alloc.cpp and see if it really fails there or somewhere else.
Sorry, I don't have a build environment set up here. And even if so, my C++ skills are limited. So I'd need some more information on what exactly I need to edit to get more information about the problem...

BTW: I'm running on a 64-Bit System (WinXP x64). NSIS is a 32-Bit process though.

Originally posted by kichik
As for UPX, I need details as it works fine for me.
Screenshot:
http://img502.imageshack.us/my.php?i...iscrashjh1.png

Log File:
http://pastebin.com/fc36186b

Compiles fine without the !packhdr command...

The strange thing is: When I compile the "full" (bigger) version of my installer, it will work with UPX just fine. Only if I compile the "light" (smaller) version, which has some files left out via !ifdef..!endif (but is identical in all other places!), it will crash using UPX! I can compile both versions just fine by removing the !packhadr command...

I did compile couple installers with 149 MB dictionary size without any problems and I only have 1GB of physical. Though I only packed about 20 MB installers. I did start compiling 300 MB installer too, but I didn't have the patience to wait it finish.

Wherever 149 MB dictionary size is feasible is a completely different matter. :p

PaR


Originally posted by {_trueparuex^}
Wherever 149 MB dictionary size is feasible is a completely different matter. :p
My installer is compressing ~160 MB of data, mostly EXE/DLL files. At the moment I squeezed the installer down to 24,8 MB. If you have to handle more than 20.000 downloads per month (~10 GB of traffic per day), every byte counts ^^

After updating to NSIS 3.28, I still get the infamous "Internal compiler error #12345: deflateInit() failed(initialization failed [-2])" error at "Generating uninstaller..." when compiling my installer with to large dictionary. At the moment 145 MB works. Bigger dictonary size doesn't work...

Furthermore MakeNSIS will still crash when using !packhdr with UPX:
http://img516.imageshack.us/img516/3...iscrashmr1.png

:cry: