我可以禁用进程的未处理异常处理程序吗? [英] Can I disable the unhandled exception handler for a process?

查看:29
本文介绍了我可以禁用进程的未处理异常处理程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 SAP 系统上执行系统测试.SAP 有时会崩溃,我想通过将虚拟机重置为之前保存的状态来从这些崩溃中恢复.

I am performing system tests on a SAP system. From time to time, SAP crashes and I'd like to recover from those crashes by resetting the virtual machine to a previously saved state.

我的问题是我无法可靠地检测到此类崩溃.我已经创建了 WER LocalDumps 注册表项,但我没有得到转储.

My problem is that I cannot detect such crashes reliably. I have created WER LocalDumps registry entries, but I don't get dumps.

SAP 似乎注册了一个未处理的异常处理程序,并对不同类型的异常执行不同的任务.有时它会显示一个消息框并终止应用程序(例如在压缩错误的情况下),有时它会伴随一个所谓的短转储.

It seems SAP has registered an unhandled exception handler and performs different tasks on different types of exceptions. Sometimes it shows a message box and terminates the application (e.g. in case of compression errors), sometimes it goes with a so-called Short Dump.

我对消息框和短转储都不感兴趣,所以我正在寻找一种方法来禁用 SAP 的未处理异常处理程序.这应该会启动 WER,它会写入转储文件,我可以采取措施重新启动系统测试.

I am neither interested in the message box, nor in the short dump, so I am looking for a way to disable the unhandled exception handler of SAP. This should bring up WER, which writes the dump file and I can take actions to restart my system tests.

出于性能原因,我不想在每次测试时都重新启动 VM.

For performance reasons, I'd not like to restart the VM on every test.

我试过了:

  • 我基本上熟悉未处理的异常处理程序.我已成功将它们应用到我自己的 .NET 代码中.
  • 我查看了 SetUnhandledExceptionFilter(MSDN) 和类似但它只适用于调用过程,我不能修改 SAP 的代码.
  • 我了解了 DisableUserModeCallbackFilter,但我认为这对我的案例没有帮助
  • I am basically familiar with unhandled exception handlers. I have applied them to my own .NET code successfully.
  • I looked at SetUnhandledExceptionFilter (MSDN) and similar but it applies to the calling process only and I cannot modify the code of SAP.
  • I read about DisableUserModeCallbackFilter but I don't think it is helpful for my case

我想知道是否有注册表设置(例如在 ImageFileExecutionOptions 中)或 Shim 我可以激活.

I wonder whether there is a Registry Setting (e.g. in ImageFileExecutionOptions) or a Shim that I could activate.

推荐答案

根据 Hans Passant 的评论(我认为这是权威答案),

According to Hans Passant's comment (which I take as an authorative answer),

操作系统中没有内置老板覆盖开关来阻止它这样做.

There is no boss override switch built into the operating system to stop it from doing this.

我终于在进程处于活动状态时将调试器附加到 SAP GUI.从启用所有异常开始,我缩小了条件范围,以便在 SAP GUI 崩溃时 WinDbg 会中断(第一次机会,然后第二次机会).

I finally attached the debugger to SAP GUI at a time where the process was alive. Starting with all exceptions enabled, I narrowed down the conditions so that WinDbg would break when SAP GUI crashed (first chance, then second chance).

这篇关于我可以禁用进程的未处理异常处理程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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