mhyllander
Posts: 11
Joined: Mon Oct 01, 2012 3:14 pm

C# custom actions - Windows error "memory could not be read"

Hi,

I am seeing sporadic errors that I rarely can reproduce. Our installer calls custom actions written in C#, following the guide at http://www.advancedinstaller.com/user-g ... rp-ca.html. I have Advanced Installer 12.0, Visual Studio 2012 and Wix Toolset 3.9.1208.0 installed. The problem is that sometimes after an installation has been run, an error dialog is shown:
example error dialog in English
example error dialog in English
installer memory ref error.png (7.38 KiB) Viewed 3243 times
Here is another example in Swedish:
example error dialog in Swedish
example error dialog in Swedish
Image.png (73.22 KiB) Viewed 3243 times
When the error occurs, the installation already appears to have completed successfully. We have traced the dialog back to the csrss.exe process, which is a standard Windows process (http://www.processlibrary.com/en/direct ... rss/26031/). Once we were also able to attach a debugger and get the following call stack:
call stack
call stack
installer ref error call stack.png (33.99 KiB) Viewed 3243 times
Judging from this call stack, it appears that the error occurs when a library is being freed, as part of the cleanup process when msiexec.exe is preparing to exit(?). The problem is that the error occurs so seldom, and I can never reproduce it at will, so it is very hard to debug. If the problem is indeed related to our C# custom actions, then I'm guessing that it could be a problem with the handling of managed code. As I understand it, Wix provides a library that acts as a proxy between msiexec and the C# assembly, but I have been unable to find any error reports related to this error and Wix.

Any help how to solve this would be very appreciated!

Thanks,
Magnus
Irina
Posts: 113
Joined: Mon Apr 27, 2015 11:42 am

Re: C# custom actions - Windows error "memory could not be r

Hi Magnus,

Unfortunately, we haven't come across something similar until now.
It is hard to tell what is the reason of such an error, having no test case.

When creating installers it is recommended to test them on clean environments.
So please, try and perform some tests on clean machines and see if the error appears again.

In case you manage to replicate the behavior on another clean machine, please send us the step-by-step use case, the .AIP file and the setup file of your package at support at advancedinstaller dot com so that we can investigate more.

Thank you for your understanding.

Kind regards,
Irina
Ecaterina Irina Grosu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”