LinkPoint 支付与 IIS7 的集成导致 w3wp.exe 崩溃
我的包装第三方 DLL 的程序集在我的 Windows 测试工具应用程序中工作很好,并且它们也工作当在调试模式下生成时,在 Web 服务中很好(VS 2008 Visual Studio Development Server)! 但是,该应用程序在本地 IIS 7 Web 服务器中运行时总是崩溃。 以下是在本地 IIS 服务器上运行时事件日志中的崩溃详细信息:
故障应用程序 w3wp.exe,版本 7.0.6001.18000,时间戳0x47919413,错误模块ntdll.dll,版本 6.0.6001.18000,时间戳0x4791a783,异常代码0xc0000374,故障 偏移量0x000aada3,进程ID 0x990, 申请开始时间 0x01c9b4133281d5d0。
讨论:我围绕来自第三方的 .NET dll(来自 FirstData 的 LinkPointTransaction.dll)编写了一个包装器,并且编写了一些引用该包装器的其他程序集。 当代码运行时,对第三方 LinkPointTransaction.LinkPointTxn.Send()
的调用会通过互联网将交易成功发送到 FirstData,但我的应用程序在某处崩溃了 w3wp.exe在该调用期间,在它到达下一行之前。 它不会抛出我可以看到的托管异常; 它只是崩溃了。 除了 IIS7 之外,在我的机器上的任何地方都可以正常工作。
我运行的是 64 位 Vista Home Premium (IIS7),但我在 IIS 中启用了 32 位应用程序,专门为此 Web 服务创建了一个单独的 AppPool,并强制我的所有程序集为 x86。 我尝试在具有管理员权限的用户帐户下运行应用程序池,而不是作为网络服务运行。 UAC 已关闭。 我尝试过集成模式和经典模式。 我已在本地防火墙中明确打开 LinkPointTransaction.dll 用于与 FirstData 通信的 TCP/IP 端口。 我什至关闭了防火墙(在路由器后面)。
使用我列出的任何解决方法,它总是可以在 Windows 应用程序以及 VS 开发服务器内的 Web 服务中运行,但从不 > 在本地 IIS 服务器上工作。
IIS 网站的 AppPool 处于经典模式。 (回应 吉顿)
My assemblies that wrap a third-party DLL work fine in my windows test harness app, and they also work fine in a web service when spawned in debug mode (VS 2008 Visual Studio Development Server)! However, the app always crashes when running in the local IIS 7 web server. Here is the crash detail from the event log when running on the local IIS server:
Faulting application w3wp.exe, version
7.0.6001.18000, time stamp 0x47919413, faulting module ntdll.dll, version
6.0.6001.18000, time stamp 0x4791a783, exception code 0xc0000374, fault
offset 0x000aada3, process id 0x990,
application start time
0x01c9b4133281d5d0.
Discussion: I wrote a wrapper around a .NET dll from a third-party (LinkPointTransaction.dll from FirstData), and I wrote some other assemblies that reference that wrapper. As the code is running, a call to the third-party LinkPointTransaction.LinkPointTxn.Send()
sends the transaction successfully to FirstData over the internet, but my application crashes w3wp.exe somewhere during that call, before it hits the next line. It does not throw a managed exception that I can see; it just crashes. Works fine everywhere on my machine except in IIS7.
I am running 64bit Vista Home Premium (IIS7), but I enabled 32bit apps in IIS, created a separate AppPool just for this web service, and have forced all of my assemblies to x86. I have tried running the App Pool under my user account with Admin privileges instead of as the Network Service. UAC is turned off. I have tried Integrated and Classic modes. I have explicitly opened the TCP/IP port in my local firewall that the LinkPointTransaction.dll uses to communicate with FirstData. I even have shut my firewall off (behind a router).
With any of these workarounds that I listed, it always works in a Windows app and also in a web service inside the VS Development Server, but never works in the local IIS server.
The AppPool for the IIS website is in Classic mode. (In response to
Gidon)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我认为这不再是一个编程问题,所以我正在“回答”它。
使用 WinDbg,我已经追踪到供应商提供的 dll。 当应用程序崩溃时,看起来 dll 取消分配内存的方式有问题。 调用堆栈显示了 dll 中的内存释放操作,然后是内核中的“堆释放”操作,然后是 ntdll 中的“释放堆”操作,以及随后的“报告堆故障”(然后是 RtlReportCriticalFailure),该操作破坏了整件事。
我仍然不明白为什么它在 Windows 窗体应用程序和 IIS 6 中工作,但在 IIS 7 中不起作用。但是,这已成为一个平台问题,而不是“编程”问题。 此外,修复它可能是供应商的责任,而不是我的责任来解决它。
更新:在向供应商提交技术支持票证后的两天内,他们提供了一组更新的集成 DLL,这些 DLL 使用您在 regsvr32 中注册的 COM 对象,并且它可以在 IIS7 64 位中运行如果您将其注册在WOW64目录中。 首先获得数据技术支持!
I don't think this is a programming question anymore, so I am 'answering' it.
Using WinDbg, I have tracked it down to the dll provided by the vendor. When the app crashes, it looks like a problem with the way the dll is de-allocating memory. The call stack shows a memory free operation in the dll, then a "heap free" operation in the kernel, then a "free heap" operation in ntdll, and a subsequent "report heap failure" (and then RtlReportCriticalFailure) that tears down the whole thing.
I still don't understand why it works in a Windows Forms app and in IIS 6, but not work in IIS 7. However, this has become more of a platform question than a 'programming' question. Besides, it is probably the vendor's responsibility to fix it rather than mine to work around it.
UPDATE: Within two days of filing the tech support ticket with the vendor, they provided an updated set of the integration DLLs that use a COM object that you register with regsvr32, and it works in IIS7 64-bit if you register it in the WOW64 directory. YEA FOR FIRST DATA TECHNICAL SUPPORT!
我向 First Data 询问了有关 DLL 的信息以及是否能够在 IIS7/.NET 4/Win 2008 64 位上运行它。 这是他们的回应:
这应该有助于其他人将来寻找类似信息。
I asked First Data about the DLLs and being able to run it on IIS7/.NET 4/Win 2008 64-bit. This was their response:
This should help others looking for similar information in the future.
IIS7中的网站是如何配置的? 如果它在集成模式下运行,请切换到经典模式。 请参阅 在 IIS 7.0 上以集成模式运行的 ASP.NET 2.0 应用程序的重大更改
How is the website configured in IIS7? If it is running in Integrated Mode switch to Classic Mode. See Breaking Changes for ASP.NET 2.0 applications running in Integrated mode on IIS 7.0
我遇到了一个非常类似的问题,经过几天的混乱,我开始意识到,如果我在 MSTest 中一遍又一遍地运行相同的代码,有时它会失败并完全崩溃测试过程,有时它会起作用美好的。
真正奇怪的是,这种情况在调试 MSTest 时最常发生,但是,如果我单击测试方法内部,然后在主按钮栏上单击“在当前上下文中调试测试”,那么它几乎总是会失败。 如果我通过单击“测试结果”窗口中的“调试”来运行测试,那么它几乎总是正确通过。
如果我不在调试模式下运行,它几乎总是可以正常工作,但有时仍然会失败。 我什至在 2 个不同的 VisualStudio 2010 实例中的 2 个不同项目之间复制/粘贴完全相同的代码,在其中一个实例中,代码将正常运行,而在另一个实例中,代码将失败。
I've had a very similar issue, and after messing with it for days, I've come to realize that if I run the same code over and over in MSTest, sometimes it fails and completely crashes the test process, other times it works fine.
The really strange thing is that it happens most often when debugging an MSTest, BUT, if I click inside the test method, then on the main buttonbar click "debug tests in current context" then it almost always fails. If I instead run the test by clicking "debug" in the "Test Results" window, then it almost always passes correctly.
It also almost always works correctly if I do not run in debug mode, but does still sometimes fail. I've even gona as far as copy/pastign the exact same code between 2 different projects in 2 different VisualStudio 2010 instances, and in one of them the code will run properly, and in another it will fail.