Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The thread tried to read from or write to a virtual address for which it does not have the appropriate access

I have developed a .NET 2.0 extension that acts as a plug in to a 3rd party application. Everything runs fine when run on anything but Citrix. When run over Citrix as a published application the extension crashes randomly which also crashes the 3rd party application.

I have opened up a dump file and have found an exception message that gets reported:

The thread tried to read from or write to a virtual address for which it does not have the appropriate access.

The application does use threading which I suspect where the above occurs, but where exactly is a mystery. If I run the extension locally on the Citrix server (i.e. not as a published app) then it works fine.

like image 363
rob Avatar asked Oct 14 '25 14:10

rob


2 Answers

The nature of the error message makes it unlikely to be a problem with the .NET 2.0 code. That is because .NET does not allow you to even attempt to read/write memory that it is not suppose to.

  • Check to see if you have any unsafe code in your extension. Code of this nature may be able to skirt the verification checks the CLR would normally perform.
  • Check to see if the code your extension uses any unmanaged code (COM or P/Invoke). The error may be generated there.
  • It is possible that there is a bug in the .NET CLR that causes problems when run in Citrix environment.

The first thing I would do is analyze that dump file to see which module the fault occurred in. You can download the Windows Debugging Tools to assist with this effort.

like image 159
Brian Gideon Avatar answered Oct 17 '25 11:10

Brian Gideon


I got the identical message when opening a project using Schneider Unity Pro. After a tedious and lengthy process of elimination, the problem was isolated to the “Do not keep history of recently opened documents” policy being enabled.

like image 41
PBuck Avatar answered Oct 17 '25 09:10

PBuck



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!