Archive: Uninstaller crash


Uninstaller crash
Hi, I am having a really weird error, and I'm stuck trying to figure out why. Any uninstaller that gets generated by my script crashes after executing the first command. What I'm looking for are suggestions how to go about debugging this. For instance, is there a way to get hold of the map data for au_.exe so I can use the postmortem debugger? Anyone have any other suggestions?

Thanks for any thoughts on this subject.

TimK.


Post a sample of your script if you don't mind.


One tip
Make sure you don't run the uninstaller from the root of any drive as this is not valid installation location (and the uninstaller is normally created in the installation location).


OK, I have figured out _what_ is causing this problem, but not _why_ it is causing it.

I am using a custom build of makensis.exe, to which I have added support for an additional callback called ".onProgress" (patch file is attached). The changes don't seem all that significant, but I'm clearly shifting a pointer somewhere, because installers compiled with this change integrated into a recent CVS sync have all kinds of weird errors -- the wrong default string populating the "where to install" textbox, for instance.

What I don't get is *why* this is disrupting memory this way. It seems like this change would be pretty harmless, since the callback func pointers are stored into a TinyGrowBuf rather than any kind of fixed size memory structure. I figure I'm missing either an initialization of some kind, or there's code somewhere that relies on the buffers holding the callback pointers to be a fixed size that is not traversing far enough. Be darned if I can find anything like either of those, though.

If anyone who is familiar with the inner workings of makensis can point out what I'm doing wrong, I'd be extremely grateful.


Sounds like you recompiled only makensis.exe and not the stubs. Rebuild everything once you apply the patch.


Thanks for the quick reply -- that was definitely *a* problem. I did a clean and a full rebuild and that fixed the problems with the installer. Unfortunately, the uninstaller crash resurfaced as a result.

Back to the drawing board . . .


Debugging the stubs is a bit problematic because makensis.exe actually edits them prior to appending the data and so PDB files are invalid (though windbg probably has some method to force-load PDBs). But map files are present in the build folder and are still valid as only sections below the code are edited.

But simply debugging the crash showed the problem, which was also my first guess once I looked a bit more into the code. progress_bar_step is zero. The first thing the debugger says is "Integer divide-by-zero". If progress_bar_len is smaller than 8, progress_bar_step will be zero.


Brilliant! And also, obvious. I should have looked at the divide ops in the patch & protected against potential div by zero.

Thanks so much for your help!