windows 什么是“无法设置分配”错误,谁发出它,我该怎么办?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2730990/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the "Cannot set allocations" error, who emits it and what can I do about it?
提问by Oliver Giesen
We've been plagued for several years by occasional reports from customers about a non-descript error message "Cannot set allocations" that appears on startup of our app. We have never been able to reproduce the problem in our own test environments so far. I have now run out of ideas for attempting to track this down. Here's a collection of observations that have accumulated over time:
几年来,我们一直受到客户偶尔报告有关在我们的应用程序启动时出现的非描述性错误消息“无法设置分配”的困扰。到目前为止,我们从未能够在我们自己的测试环境中重现该问题。我现在已经没有任何想法可以尝试追踪这个问题了。以下是随着时间的推移积累的一系列观察结果:
- Error message text reads "Cannot set allocations" (note absence of punctuation).
- The window title simply reads "Error" (or the localized equivalent).
- The "Cannot set allocations" text is always in English regardless of OS locale.
I have so far not been able to locate the DLL or EXE containing the message text.
Google is chock full of reports of this errorfor a variety of different products - but no solutions.
The only unifying aspect between the affected products I could make out so far was that they all appear to come in the form of DLLs that load into third-party processes (such as addins for Visual Studio or Windows Explorer shell extensions).
Our app is actually a shareware COM-addin for MS Outlook, written in Delphi (i.e. native code - no .NET).
The prime suspect in our case is the third-party licensing wrapper that we're using which decrypts and uncompresses our DLL into memory on the fly. Obviously I couldn't simply give an unprotected version of our app to the affected customers to verify this suspicion. Maybe the other vendors that this has been reported against are using similar products.
Debug versions of the protection wrapper supplied to us by the licensing vendor yielded no results: The log files looked exactly the same as from sessions where the error did not occur. Apparently the "inner" DLL gets decrypted and uncompressed all right but for some reason still fails to get loaded by the host process.
By creating an unprotected "loader" DLL we have been able to pinpoint the occurrence of the error somewhere behind the
LoadLibrary
call that is supposed to load our DLL into memory.Extensive logging and global exception hooks in our own code (both the unprotected loader and the protected "core"-DLL) yielded no results at all. The error is obviously raised somewhere else.
The problem described in this earlier question of minewas very probably prompted by the same issue. This was before we created the unprotected loader stub.
The error only occurs at about 1-2% of our customers - whereas typically all installations at any affected customer's site are affected the same.
- Sometimes the error goes away after we release a new version but often it will come back again after a couple of weeks or months.
- Once the error has started to occur on a machine it does so consistently.
The error never occurs while connected to the affected machine via remote access (e.g. VNC, RDP, TeamViewer, etc.) and none of the affected customers are within travel distance from us so all we have to go by is log files and "eye-witness reports".
One customer reported that the error message dialog apparently was non-modal, i.e. he was able to simply move the dialog box to the side and continue working with the application (minus the functionality that our DLL would have provided). Not sure whether this is universally true in all other occurrences, too.
In some cases customers have been able to permanently rid themselves of the error by disabling or uninstalling other addins from other vendors that were sharing the host application with our own product.
The error has so far been observed on Windows XP, Vista and 7.
During the last few weeks we had a surge of reports from Outlook 2003 / Windows 7 users. Could the situation have been made worse by a recent Windows/Office-update?
- 错误消息文本显示为“无法设置分配”(注意没有标点符号)。
- 窗口标题简单地显示为“错误”(或本地化的等效项)。
- 无论操作系统区域设置如何,“无法设置分配”文本始终为英文。
到目前为止,我还没有找到包含消息文本的 DLL 或 EXE。
谷歌充斥着各种不同产品的此错误报告- 但没有解决方案。
到目前为止,我可以确定的受影响产品之间唯一的统一方面是它们似乎都以加载到第三方进程(例如 Visual Studio 的插件或 Windows 资源管理器外壳扩展)的 DLL 的形式出现。
我们的应用程序实际上是一个用于 MS Outlook 的共享软件 COM 插件,用 Delphi 编写(即本机代码 - 没有 .NET)。
我们案例中的主要嫌疑人是我们正在使用的第三方许可包装器,它可以动态地解密我们的 DLL 并将其解压缩到内存中。显然,我不能简单地向受影响的客户提供我们应用程序的未受保护版本来验证这种怀疑。也许其他被举报的供应商正在使用类似的产品。
许可供应商提供给我们的调试版本的保护包装没有产生任何结果:日志文件看起来与未发生错误的会话完全相同。显然,“内部”DLL 可以被解密和解压缩,但由于某种原因,主机进程仍然无法加载。
通过创建一个不受保护的“加载器”DLL,我们已经能够查明在
LoadLibrary
应该将我们的 DLL 加载到内存中的调用后面某处发生的错误。我们自己的代码(不受保护的加载程序和受保护的“核心”-DLL)中的大量日志记录和全局异常挂钩根本没有产生任何结果。错误显然是在其他地方引发的。
我之前的这个问题中描述的问题很可能是由同一问题引起的。这是在我们创建不受保护的加载程序存根之前。
该错误仅发生在我们大约 1-2% 的客户身上 - 而通常任何受影响客户站点的所有安装都会受到相同的影响。
- 有时错误在我们发布新版本后消失,但通常几周或几个月后它会再次出现。
- 一旦错误开始在机器上发生,它就会始终如一地发生。
通过远程访问(例如 VNC、RDP、TeamViewer 等)连接到受影响的机器时,错误永远不会发生,而且受影响的客户都在距离我们不远的地方,所以我们所要做的就是记录文件和“眼睛-证人报告”。
一位客户报告说,错误消息对话框显然是非模态的,即他能够简单地将对话框移到一边并继续使用应用程序(减去我们的 DLL 将提供的功能)。不确定这是否也适用于所有其他事件。
在某些情况下,客户可以通过禁用或卸载与我们自己的产品共享主机应用程序的其他供应商的其他插件来永久消除错误。
到目前为止,该错误已在 Windows XP、Vista 和 7 上观察到。
在过去的几周里,我们收到了大量来自 Outlook 2003 / Windows 7 用户的报告。最近的 Windows/Office 更新会使情况变得更糟吗?
Does anyone have any experience with this error at all?
有没有人对这个错误有任何经验?
Or any more ideas for investigating this?
或者有更多的想法来调查这个?
采纳答案by 500 - Internal Server Error
This is going to be pure guess-work, but it sounds like maybe your third-party licensing software is trying to load your DLL at a particular location in memory, which - on these failing systems - happens to already be occupied by something else, perhaps a global hook DLL.
这将是纯粹的猜测,但听起来可能您的第三方许可软件正试图将您的 DLL 加载到内存中的特定位置,而在这些出现故障的系统上,该位置恰好已经被其他东西占用,也许是一个全局钩子 DLL。
回答by tim
I have only recently had this happen, which prompted my search and I ended up here. I can tell you that with me for sure it is in windows 7 home premium BUT ONLY WITH IE9 (which I hate by the way) it reduces the user back to the dummy stage and assumes that we have to be repeated flagged about everything.It will keep asking you if you want to disable add ons to speed up load times but usually on things that aren't really the things slowing the browser down in the first place,it is there is too much garbage loading in the first place.But back to the "Cannot set allocations", I for one have never expirianced it in any other browser which is not to say it doesn't happen with them.
我最近才发生这种情况,这促使我进行了搜索,最后我来到了这里。我可以肯定地告诉你,它在 Windows 7 家庭高级版中,但仅适用于 IE9(顺便说一句,我讨厌它)它将用户减少到虚拟阶段,并假设我们必须重复标记所有内容。它会一直问你是否要禁用加载项以加快加载时间,但通常在那些不是真正降低浏览器速度的事情上,首先是垃圾加载太多。但是回到“无法设置分配”,我从来没有在任何其他浏览器中使用过它,这并不是说它们不会发生。
回答by Mark Wilkins
If you have a customer who is willing to work with you a bit, it might shed some light on the situation to get a crash dump (e.g., with ADPlusor maybe simpler with Sysinternals' ProcDump) when the error message is showing. That would show what modules are loaded and possibly the callstack (if it is from a message box at the time of the error as opposed to one that is catching an exception after the problem).
如果您有一位愿意与您合作的客户,当显示错误消息时,它可能会为获得故障转储(例如,使用ADPlus或使用Sysinternals 的ProcDump更简单)的情况提供一些线索。这将显示加载了哪些模块以及可能的调用堆栈(如果它来自错误发生时的消息框,而不是在问题发生后捕获异常的消息框)。
回答by John
I also have experienced the "Cannot set allocations" issue. Royal pain. I had disabled Java, since I did not seem to need it, I used add/remove programs to remove Java from my system. Then I stated to get those errors. I have reinstalled, but disabled Java in IE explorer. Now I do not get the error anymore. Not a programmer, don't know why this happened. Maybe a clue for someone. Win 7 - 64bit OS IE Explorer 10. Hope this helps someone figure this out. John
我也遇到过“无法设置分配”的问题。皇家痛苦。我禁用了 Java,因为我似乎不需要它,我使用添加/删除程序从我的系统中删除 Java。然后我说要得到这些错误。我已经重新安装,但在 IE 资源管理器中禁用了 Java。现在我不再收到错误了。不是程序员,不知道为什么会这样。也许对某人来说是一个线索。Win 7 - 64 位操作系统 IE Explorer 10。希望这有助于有人解决这个问题。约翰
回答by vt.
I've seen this happen. In my case a global hook dll created a large memory file mapping, perhaps to the memory the licensing dll was counting on.
我见过这种情况。在我的例子中,全局钩子 dll 创建了一个大内存文件映射,可能是许可 dll 所指望的内存。
回答by Yogurtu
I see "Cannot set Allocations" when I open google chrome only. Also after that, chrome closes with a msg saying "Whoa chrome has crashed..."
当我只打开谷歌浏览器时,我看到“无法设置分配”。同样在那之后,chrome 关闭并显示一条消息“哇,chrome 崩溃了......”
Still no solution :(
仍然没有解决方案:(
回答by mark b
Also not a programmer, but it always happens when I open Chrome. It opens second window with error message 'cannot set allocation'. I usually close it and go on my way. if i don't it usually causes a crash. doesnt happen on any other browsers.
也不是程序员,但它总是在我打开 Chrome 时发生。它打开带有错误消息“无法设置分配”的第二个窗口。我通常关闭它然后继续我的路。如果我不这样做,它通常会导致崩溃。不会发生在任何其他浏览器上。