.net 4 调试 api 导致调试者出现访问冲突
.net 4 调试 api 有什么方法可以在启动过程中以某种方式破坏应用程序的状态吗?
我遇到的问题如下:
- 如果我使用 .net 调试 API(Visual Studio 2010、Sharp Development 4、mdbg)从调试器中启动应用程序,我会遇到各种随机访问冲突。
- 如果我从调试器中启动我的应用程序而不使用.net调试API(delphi 2007,带有sos扩展的windbg),一切都会正常。
- 如果我直接启动我的应用程序,然后附加一个调试器(例如 Visual Studio 2010、Sharp Development 4、mdbg、delphi 2007、windbg),则一切正常。
- 如果我回到 .net 3.5 和 clr 2.0 我完全没有问题。
那么托管调试 API 中从 .net 3.5 到 4.0 的变化是什么导致我的应用程序在启动时抛出访问冲突?
该应用程序是用 delphi(非托管)和 c#(托管)编写的,使用 托管 vcl 进行互操作。
我几乎无法给出任何例子来重现这个问题,所以我知道回答这个问题可能是不可能的,但如果对调试 API 有更深入了解的人可以给我一个正确方向的提示,或者可以帮助我缩小范围会非常感激的。
is there any way the .net 4 debugging api can somehow corrupt the state of an application during startup?
the issue i have is the following:
- if i start my application from within a debugger using the .net debugging api (visual studio 2010, sharp develop 4, mdbg), i get various random access violations.
- if i start my application from within a debugger not using the .net debugging api (delphi 2007, windbg with sos extension) everything works fine.
- if i start my application directly and later on attach a debugger to it (like visual studio 2010, sharp develop 4, mdbg, delphi 2007, windbg), everything works fine.
- if i move back to .net 3.5 and clr 2.0 i have no problems at all.
so what changed from .net 3.5 to 4.0 in the managed debugging api causing my application to throw access violations if started with it?
the application is written in delphi (unmanaged) and c# (managed) using managed vcl to do the interop.
i can hardly give any example to reproduce this issue so i'm aware that answering this question might be impossible, but if someone with more insight to the debugging api can give me a hint in the right direction or could help me narrow it down i'd be very thankful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只是为了好玩尝试禁用 Visual Studio 托管进程。在 Visual Studio 中右键单击该项目,转到“调试”选项卡,然后取消选中“启用 Visual Studio 托管进程”复选框。
我们在运行 32 位应用程序的 64 位系统上的托管/非托管领域中看到了一些奇怪的东西。
Just for fun try and disable the Visual Studio hosting process. In Visual Studio right click on the project, go to the 'Debug' tab, and uncheck the "Enable the Visual Studio hosing process" check box.
We've seen some strange stuff in the managed/unmanaged land on 64 bit systems running 32 bit apps.
根据经验提供的一些附加信息:重要的是使用 COMPLUS_MDA 环境变量(记住之后重新启动 VS2010),而不是 MDA 注册表项。我尝试按照 MSDN 文章 http: //msdn.microsoft.com/en-us/library/d21c150d,正如文章指出的那样,这应该具有相同的结果,但那不起作用。
Some additional info based on experience: It is important to use the COMPLUS_MDA environment variable (remember to restart VS2010 afterwards), not the MDA registry key. I tried setting the registry key (followed by restarting the computer) as described by the MSDN article http://msdn.microsoft.com/en-us/library/d21c150d, as the article indicated this should have the same result, but that didn't work.