使用Ping时出现蓝屏

使用Ping时出现蓝屏

本文介绍了使用Ping时出现蓝屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了BSODon在ping中间结束调试的错误.

I'm running into the bug where it BSODon ending debugging in the middle of a ping.

我有几种方法可以在我的(wpf)应用程序中禁用它(我在这里连续进行ping操作),但是有时我忘记这样做了,并且会死于BSOD.

I have a few ways to disable it in my (wpf) application (where I ping continuously), but sometimes I forget to do so and BSOD.

我想通过更改全局AllowRealPinging变量并在退出调试器之前在回调中休眠2秒钟来解决这个问题,所以我不会BSOD.

I'd like to get around that say by changing a global AllowRealPinging variable and sleeping for 2 seconds in a callback before exiting the debugger so I don't BSOD.

推荐答案

这是Windows 7中的一个已知错误,当​​您终止进程时,您会在tcpip.sys中得到带有错误检查代码0x76,PROCESS_HAS_LOCKED_PAGES的BSOD.最相关的反馈文章在这里.也包含在此SO问题中.那里没有很好的答案,唯一已知的解决方法是回退到4.0之前的.NET版本,它使用另一个不会触发驱动程序错误的winapi函数.

This is a known bug in Windows 7, you'll get a BSOD with bug-check code 0x76, PROCESS_HAS_LOCKED_PAGES in tcpip.sys when you terminate the process. The most relevant feedback article is here. Also covered in this SO question. No great answers there, the only known workaround is to fallback to a .NET version earlier than 4.0, it uses another winapi function that doesn't trigger the driver bug.

在调试时避免ping肯定是避免此问题的最佳方法.您想要的方法行不通,程序遇到断点时将被完全冻结,停止调试时将被冻结.

Avoiding pinging while you debug is certainly the best way to avoid this problem. Your desired approach is not going to work, your program is entirely frozen when it hits a breakpoint, kaboom when you stop debugging.

最简单的方法是仅在连接调试器的特定情况下才开始ping操作.使用System.Diagnostic.Debugger.IsAttached属性在代码中进行检测.

The simplest way is to just not starting pinging in the first place in the specific case of having a debugger attached. Use the System.Diagnostic.Debugger.IsAttached property to detect this in your code.

这篇关于使用Ping时出现蓝屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 05:12