C# WPF 0xC0000005: Access violation - c#

While developing a WPF app I encountered this crash.
I tried with/without debugger, Release/Debug configurations, same result.
The message 0xC0000005: Access violation was shown only in Output window, when I started the app VS appeared to be running it for ~10 seconds, then stopped as if I just closed the app normally, but it never showed.
Disabling Just My Code and enabling Break for every exception didn't help.
I have made no changes to the code, and the day before it ran without a problem.
Re-cloned the git repo, still nothing.

The problem was a DirectX overlay app (MSI Afterburner). Turning it off helped.
I went to Control Panel\System and Security\Security and Maintenance\Problem Reports (or Search for "View all problem reports" in Start), the report said Fault Module Name: d3d9.dll, that made me think it could be Afterburner.

Related

Resolving UWP Application Hangs

I built a UWP application which logs data from an internal class to a .csv file using the CSVHelper library. I am having a problem where the application stops responding when running in debug mode without any exceptions being thrown. The app also does not crash. In VS the diagnostic session timer is stopped but the code is still "running". There is no stack trace when I break, the application won't hit any breakpoints and closing the app with the "X" closes the window visually but it doesn't end the debugging session and I suspect the process remains running. I have to use the "Stop Debugging" button in visual studios to end the session. It occurs at seemingly random intervals unrelated to what the app is currently doing. The crashes are usually in the 50min+ execution time range though it has happened earlier.
How do I go about troubleshooting this issue?
I really don't know where to start without any exceptions or even a clue as to what causes the application to hit this state. I would include code but other than just linking the entire repo I am not sure which sections would actually be helpful as I don't know, nor can I seem to find a way to identify what code is running to enter this state.

C# Windows Forms application hangs and need help reading the error log

After the latest release of my application, users are experiencing application "locks" where the program just remains unresponsive. This occurs at different times and never after a specific action.
At one point I found an entry in the Windows Error Logs, but I can't figure out what's happening there.
My main questions:
anyone experienced anything like this with ReportViewer in Windows Forms application?
Can someone explain the attached error log (please excuse the Dutch)
Update
Still no idea on how to fix this issue. Application keeps randomly freezing with different users. Everytime an application-hang is preceeded by the above mentioned .NET Runtime error and event 10016 (DistributedCOM). I have tried to resolve the DCOM issue by following this answer, but that did not solve the problems.
Also, I have made sure that all the forms with reportviewers (only 4) and every method that has to do with reportviewer operations have proper errorhandling.
Further explanations: from a windows form I open another form which contains a reportviewer. I show this form as a dialog.
After long inspection I found the culprit: in a new process which was started in a backgroundworker a form with a reportviewer was opened but never disposed. Closing the form and disposing it solved my issue.

Anyway to deal with weird errors while my .net program running?

I made a program, which works fine on my PC without any errors, it also works fine on some office PCs, but it crashes without any describable error on customer's PC and some others.
Crashes are completely random, sometime it may crash and sometimes not.
Crashes are not related with any actions, sometimes it may crash when they just look at the program and wait for crash.
Customers send me this beautiful screens and want me to solve this.
There you see common error reporting dialog, but not info about Exception.
My program uses Unity Web Player running in WebBrowser control. It's always run in background on the hidden tab which becomes visible when needed.
Any ideas how to handle such errors?
I think you should first ensure that the environment at your place and that of your customers are identical.
Maybe there're dll or other programs installed at your place (Unity web player as you mentioned for example) or anything in your Registry that may differ.
Else there's no point in getting error on one PC and not on another.
Make sure all dll are well deployed
Check your registry,
Ensure that all related programs are well installed

How to debug a WP 8 app that gets killed by the phone seemingly without any error in Visual Studio Express 2012

A bit of a general question perhaps. I have an app that is quite simple, basically a wrapper app for a webpage. This app crashes on WP8, and it happens usually when you start the app, then go to the home screen and hold the back button to bring up the recent apps view and go back into the app. The app is just killed.
What I am wondering is that before when I have had problems with a WP app crashing on WP7.5 I would run the app on the phone from Visual Studio Express and when the app crashed I could see the error and stack trace in VSE. But with the error I am having now its as if VSE doesnt even know that the app has been terminated. It still shows that it is running.
One thing I tried was to add event handlers for the onNavigatedTo event and set a breakpoint in there to see if I could catch the app when I was switching back to it and then do step by step from there. But when I did that and the app crashed all I got from VSE was a message saying that it had failed to bind the breakpoint.
I also tried the emulator, hoping it would give me better insight but its the same as running the app on a phone. So now I have an app that is very unstable on WP8 (works solid as a rock on WP7.5 though) and I have no idea what exactly is going wrong.
So my question is if there is any way to get more information on how and why the app is crashing :)
You also can use the Event View of Windows.
I have a similiar problem (sometimes while running and accessing the isolated storage the app just gets killed without any notice) and the event views provides some useful information.
I'd suggest to put debug output (Debug.WriteLine) in App_Activated and App_Closing methods in the App.xaml.cs file. And also to the RootFrame_NavigationFailed and Application_UnhandledException. All those methods has a potential to run when you return to your app and it crashes. If this would not help (you'll see no output in VS Output window), try putting some other output there, like writing synchronously to a file in the isolated storage, or activate some launcher (like email compose task, see here). The point here is to perform some other activity when failure happens.
Another thing you could try is to break execution in VSE, when app is already seems to be terminated. I mean, pressing the "pause" button in the debugger. It could potentially be informative.

Application sometimes crashes when opening a dialog on only one machine

so this is kind of a weird error. On one machine from one of our customers (Windows XP SP3) our program crashes when trying to open a filter dialog via ShowDialog().
What happens: The user works as expected he/she does nothing unnormal or wrong and everything he/she does is/was tested on several machines (ranging from Win XP 32 bit to Win 7 64 bit).
Now, after some time he/she want's to use the filter dialog (which he/she did at that point like a dozen times) and the application crashes. You get that wonderful "$applicationname caused a problem and has to be terminated" message from Windows XP, beneath it you can see the filter dialog, partially build (meaning: you can see the window, a scroll bar and transparent 'holes' where the text controls/labels should be.
In the Windows eventviewer you can see an entry like this
Event ID: 1000
Source: .NET Runtime 4.0 Error Re (maybe something stands behind this and it says 'Reporting'?!)
Faulting application $applicationname.exe, version $versionnumber,
stamp $someRandomNumbers, faulting module ntdll.dll, version
5.1.2600.6055, stamp 4d00f27b, debug?0, fault address 0x00446da
Now, what weirds me out: The position where the dialog is opened via ShowDialog, is embedded in 2(!) try...catch blocks. How is it possible for the application to crash? There aren't even logfileentries (something that is done in EVERY catch block we've in that program and it's always the first thing we do) about this crash.
I already uninstalled the application and .NET 4 from that machine, rebooted installed everything again, installed Windows Updates and rebooted again. Same result.
*edit
just noticed something: When I close the message from microsoft, an additional entry in the eventviewer is created:
The process was terminated due to an unhandled exception I guess that's the meaning in english, since the original message is in another language I had to translate
Exceptioncode: c015000f, address 7c9546DA address is always the same
As #Hans said, it's caused by incorrect use of the De/ActivateActCtx winapi functions.
I met the same problem when I write a VB App. using my ActiveX Contrl(MFC). I place a dialog variant in the control class definition.
Like below:
CMyDlg dlg;
So when does the dialog initilized is not in my control. And that made the same issue as you. When the control should be displayed, the error appears.

Categories