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

时间秒杀一切 提交于 2019-12-07 12:24:05

问题


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.

I've not had much luck with google. 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 (ie not as a published app.) then it works fine.

I'm not expecting an answer here (be great if someone did!) due to the general nature of the issue but if anyone could point me in a direction of helping to nail the issue or describing the error message I would be much appreciative.

Thanks,

Rob


回答1:


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.




回答2:


I don't know if this will help.

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



来源:https://stackoverflow.com/questions/3352518/the-thread-tried-to-read-from-or-write-to-a-virtual-address-for-which-it-does-no

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!