How should you diagnose a bug? SEHException - External component throws an exception

Whenever the user reports an error, for example

System.Runtime.InteropServices.SEHException - Did an external component raise an exception?

Is there anything that I, as a programmer, can do to determine the cause?

Scenario: One user (using a program written by my company) reported this error. This may or may not be one mistake. They mentioned that last month the computer “stopped working” twice. I learned from experience not to take this description too literally, because usually this means that someone connected to the computer does not work as expected. They could not give me more detailed information, and I could not find any registered errors. Therefore, this may or may not be this error.

From the stack trace, the actual error was to build a class that does not directly call any interaction code, but is possibly complicated by the fact that the object can be part of a list bound to the DevExpress Grid database.

The error was "caught" using an unhandled exception procedure, which usually closes the program but has the ability to ignore and continue. If they decided to ignore the error, the program continued to work, but the error was repeated the next time this procedure was started. However, this did not happen after closing and restarting our application.

The computer in question does not appear to have been stressed. It works in Vista Business, has 2 GB of memory, and, according to the Task Manager, it uses about half of what is with our application about 200 MB.

There is another piece of information that may or may not be relevant. In another section of the same program, a third-party component is used, which is actually a dotnet shell around the native DLL, and this component has a well-known problem when you rarely get

Attempted to read or write protected memory. This often indicates that another memory is corrupted.

Component manufacturers say this has been fixed in the latest version of their component, which we use on our own, but this has not yet been provided to the client.

Given that the consequences of the error are low (no work is lost and reloading the program and returning to where they only take minutes), and given that the client will soon receive a new version (with an updated third-party component), I can obviously cross my fingers and I hope that the error does not happen again.

But is there anything else I can do?

+75
c # winforms error-logging
Aug 21 '09 at 19:35
source share
7 answers

Yes. This error is a structured exception that was not mapped to a .NET error. Your DataGrid mapping probably throws your own exception, which was not selected.

You can find out what exception is happening by looking at the ExternalException.ErrorCode property. I would check the stack trace, and if it is tied to the DevExpress grid, report the problem to them.

+26
Aug 21 '09 at 19:49
source share

I had a similar problem with SEHException that was thrown when my program first used its own dll shell. It turned out that the native DLL for this shell is missing. The exception in no way helped in resolving this. Which ultimately helped, in the end, procmon was running in the background and checking to see if there were any errors loading all the necessary DLLs.

+6
Jul 11 '13 at 8:45
source share

if you have a problem described in this post:

asp.net mvc debugger throwing SEHException

then solution:

If you have any application from Trusteer (for example, rapport or something else), just uninstall and reboot your system, it will work fine ... found this solution here:

http://forums.asp.net/t/1704958.aspx/8/10?Re+SEHException+ thrown + when + I + run + application +

+5
Aug 02 '11 at 10:50
source share

Component manufacturers say this was fixed in the latest version of their component, which we use on our own, but it was given to the client.

Ask the component manufacturer how to check if the problem that the client is experiencing is a problem that they say they fixed in their latest version, without / before deploying their latest version to the client.

+3
Aug 21 '09 at 19:49
source share

I came across this error when the application is located in a shared network folder and the device (laptop, tablet, etc.) is disconnected from the network while using the application. In my case, this was due to the Surface tablet going beyond wireless. No problem after installing the best WAP.

+1
Mar 03 '17 at 21:17
source share

One more information ... Was this a problem today on Windows x64 for Windows 2012 R2, where the application was launched from a network / network path. The problem arose for one application for all terminal server users. Running the application locally worked without problems. After rebooting, it started working again - the thrown SEHException was Constructor init and TargetInvocationException

0
Oct 23 '17 at 9:57 on
source share

My machine configuration:

Operating System: Windows 10 Version 1703 (x64)

I encountered this error while debugging my C # .Net project in the Visual Studio 2017 Community edition. I called my own method, executing p / invoke on the C ++ assembly loaded at runtime. I ran into the same error that the OP is reporting.

I realized that Visual Studio was running with a user account that was not an administrator on the computer. Then I restarted Visual Studio under a different user account, which was the administrator on the computer. All this. My problem is resolved, and again I did not come across this problem.

It should be noted that the method that is called on the C ++ assembly had to write a few things in the registry. I did not go about debugging the C ++ code to do some RCA, but I see that it all failed because administrative privileges are required to write the registry to the Windows 10 operating system. Thus, earlier, when Visual Studio was run under a user account that did not had administrative privileges on the computer, then native calls failed.

0
Feb 21 '18 at 12:42
source share



All Articles