IcmpSendEcho2失败,失败并出现WSA_QOS_ADMISSION_FAILURE和ERROR_NOACCESS [英] IcmpSendEcho2 fails with fails with WSA_QOS_ADMISSION_FAILURE and ERROR_NOACCESS

查看:299
本文介绍了IcmpSendEcho2失败,失败并出现WSA_QOS_ADMISSION_FAILURE和ERROR_NOACCESS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可对一堆服务器执行ping操作的应用程序.它运行了好几天,但是突然之间会出现以下两种类型之一的许多故障:

I have an application that pings a bunch of servers. It runs great for days, but suddenly will have many failures of one of two types:

WSA_QOS_ADMISSION_FAILURE(11010)由于缺少资源而发生QoS错误"

WSA_QOS_ADMISSION_FAILURE (11010) "A QoS error occurred due to lack of resources"

ERROR_NOACCESS(998)对内存位置的无效访问."

ERROR_NOACCESS (998) "Invalid access to memory location."

奇怪的是,错误成堆出现.即所有ping可能在几分钟内因上述错误之一而失败.然后清除.稍后,所有ping操作将在几分钟内失败,并出现另一个错误.他们似乎从来没有交织过.

The odd thing is the errors come in bunches. Ie all pings might fail for a few minutes with one of the above errors. Then it clears up. Later all pings will fail for a few minutes with the other error. They don't seem to ever interleave.

这在Windows 2008 R2上发生.我无法随意复制它,但是如果我等待一两天,它总是会再次发生.

This happens on Windows 2008 R2. I can't reproduce it at will, but if I wait for a day or two, it always happens again.

我检查并重新检查,然后再次检查以确保关闭所有打开的手柄.

I checked and rechecked, then checked again to ensure I close all handles that were opened.

应用程序首次启动时永远不会发生,因此与查找或加载DLL无关.它会在一段时间后自行修复,因此似乎并不是资源枯竭.而且它可以正常运行数天,因此这似乎不是API使用问题.

It never happens when the app first starts, so doesn't seem to be related to finding or loading DLLs. And it fixes itself after a while, so doesn't seem to be resource exhaustion. And it runs just fine for days, so it doesn't seem to be an API usage problem.

在这里不知所措.有人有什么想法吗?

At a loss here. Does anyone have any ideas?

谢谢

推荐答案

事实证明,错误代码11010实际上不是WinSock的WSA_QOS_ADMISSION_FAILURE(此处未涉及),而是与上述代码完全不同的值. IP堆栈的 ICMP_ECHO_REPLY结构具有更有意义的含义:

It turns out that the error code 11010 is actually not WSA_QOS_ADMISSION_FAILURE from WinSock (which is not involved here), but a completely different value from the IP stack's ICMP_ECHO_REPLY structure with much more meaningful meaning:

IP_REQ_TIMED_OUT (11010)请求已超时

IP_REQ_TIMED_OUT   (11010)   The request timed out

您应该致电 GetIpErrorString() 首先并且只有"如果函数失败,请使用FormatMessage获取返回的错误的消息字符串".

不幸的是,这对其他值998没有帮助.

Unfortunately, that does not help with that other value, 998.

一个线索可能是页面"将NT状态错误代码映射为Win32错误代码",它表示映射(或映射到2005年最后一次更新时)到Win32代码998(ERROR_NOACCESS)的NT状态条件更为广泛:

One clue might be the page "Mapping NT Status Error Codes to Win32 Error Codes", which says that the NT status conditions which map (or mapped when it was last updated, in 2005) to the Win32 code 998 (ERROR_NOACCESS) are more broad:

STATUS_DATATYPE_MISALIGNMENT            ERROR_NOACCESS
STATUS_ACCESS_VIOLATION                 ERROR_NOACCESS
STATUS_DATATYPE_MISALIGNMENT_ERROR      ERROR_NOACCESS

在IOCTL调用期间(它将ICMP回显请求发送到要真正处理的内核)期间,如果发生任何故障,似乎都可能吞下了基础异常,并且仅发回此通用Win32代码.

It seems likely that whenever something fails during the IOCTL call (which sends the ICMP echo request to the kernel to be really handled), the underlying exception is swallowed if possible and only this generic Win32 code is sent back.

因此,可能是您确实向函数传递了一些不完全正确的数据(例如堆栈上未对齐的缓冲区,这可能解释了为什么它偶尔发生),甚至暗示了ICMP堆栈中的某些错误.恐怕只有一些核心的内核调试才能揭示出真正的原因.

Therefore it might be that you are really passing some not entirely correct data to the function (like unaligned buffer on the stack, that might explain why it happens sporadically), or even hint at some bug inside the ICMP stack. I'm afraid that only some hardcore kernel debugging could reveal the real cause.

这篇关于IcmpSendEcho2失败,失败并出现WSA_QOS_ADMISSION_FAILURE和ERROR_NOACCESS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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