使用 Ping 时蓝屏 [英] Blue screen when using Ping

查看:19
本文介绍了使用 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 秒来解决这个问题,这样我就不会蓝屏了.

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 的蓝屏.最相关的反馈文章在这里.在这个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 时蓝屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆