I am getting the above mentioned exception in PointerPressed that too only in the case of MFC application hosted using XAML Islands. In normal UWP application it is working fine. Essentially no other Pointer events are fired in this scenario (Released, Canceled, CaptureLost,Exited etc) but we need to handle some UI changes in PointerReleased.
Kindly suggest any workarounds for the same.
First I will describe the crash types I know about. Scroll down for the actual question. Note that I am only interested in crashes that are handled by Windows. Specific applications and frameworks sometimes have their own crash handlers (eg. Cygwin, the VCL, Java or .NET), which I will not discuss.
Dr Watson
On Windows XP, most unhandled "Structured Exceptions" such as access violations produce a Microsoft Application Error Reporting dialog (it was later renamed "Windows Error Reporting" but the executable is dwwin.exe and I will call it Dr Watson):
It is easily reproduced with *(char*)0=0;
FatalAppExit
Calling FatalAppExit() produces a MessageBox and Event Log entry, but no Dr Watson:
Stack overflow
On Windows XP a stack overflow causes the process to unceremoniously exit with no notification at all. (I think this was fixed starting with Vista)
It can be reproduced with main(){main();}
My question is, what causes one of these:
This dialog is owned by csrss.exe, and by the time I see it, the AcroRd32.exe process has exited.
It also writes an entry in the System Event Log (which a Dr Watson crash doesn't do):
I can reproduce the dialog and Event Log entry (but obviously not an actual crash), with this call to MessageBox:
MessageBox(
0,
"The exception unknown software exception (0xc0000409) occurred in the application at location 0x00404def.",
"AcroRd32.exe - Application Error",
MB_ICONSTOP | MB_SERVICE_NOTIFICATION);
I've ruled out Adobe Reader running as a service. It is version 11.0.08. The crash seems to happen sporadically when a Windows Explorer window with a PDF file selected becomes the active window.
Of course I'm not asking you to troubleshoot Adobe Reader for me, just how to produce an "Application Error" / "Application Popup" type of crash, preferably programmatically so I can understand what's going on.
This looks like the work of kernel32.UnhandledExceptionFilter. You might be able to trigger this error message with:
EXCEPTION_RECORD Rec = {
ExceptionCode : 0xc0000409, /* STATUS_STACK_BUFFER_OVERRUN */
ExceptionAddress : cast(void*) 0x404def,
};
CONTEXT Ctx;
RtlCaptureContext(&Ctx);
EXCEPTION_POINTERS Xcep = {
ExceptionRecord : &Rec,
ContextRecord : &Ctx,
};
UnhandledExceptionFilter(&Xcep);
However on Windows 7 that didn't do it for me, it just went straight to Dr Watson.
What does seem to work on W7 is this:
size_t[2] Params = [
0xc0000409, /* STATUS_STACK_BUFFER_OVERRUN */
0x404def, /* exception address */
];
int Response;
NtRaiseHardError(
0xc0000144 /* STATUS_UNHANDLED_EXCEPTION */ |
0x10000000 /* HARDERROR_OVERRIDE_ERRORMODE */,
Params.length,
0, /* UnicodeStringParameterMask */
Params.ptr,
2 /* OptionOkCancel */,
&Response
);
I know UnhandledExceptionFilter has this code somewhere, I just don't know what conditions it needs to take that code path. But you can just call NtRaiseHardError like this yourself.
Here's the result:
I don't use XP any more so you'll have to experiment yourself to see how these methods behave on XP, but hopefully this will give you a starting point.
The error dialog owned by CSRSS (which can also be programmatically triggered by a manual call to NtRaiseHardError, see this answer), is displayed on Windows when you have an unhandled exception. For all Win32 applications, a default exception handler for unhandled exceptions is set up by kernel32.dll, and this is this handler that does the job of either showing the Windows Error Reporting dialog, or showing the error dialog.
For the details, the open-source ReactOS project (which aim is to "re-create" Windows in an open-source way using clean-room RE) has similar code, that should help you knowing precisely in which conditions the error dialog appears: see the UnhandledExceptionFilter() function in dll/win32/kernel32/client/except.c.
How can I troublehshoot _NSCoreDataOptimisticLockingException messages I am getting in the console? or debug it?
I am using background thread to update the core data context and the I am merging the context on the main thread with the main thread object, but I am geting these console message and I am unable to see where they are coming from.
objc[58487]: EXCEPTIONS: catch(_NSCoreDataOptimisticLockingException)
objc[58487]: EXCEPTIONS: unwinding through frame [ip=0x2235ec7 sp=0xb08e8a10] for exception 0x3dd42950
objc[58487]: EXCEPTIONS: unwinding through frame [ip=0x22622a6 sp=0xb08e8ad0] for exception 0x3dd42950
objc[58487]: EXCEPTIONS: handling exception 0x3dd42950 at 0x226234a
objc[58487]: EXCEPTIONS: finishing handler
The first answer from #jonusx talked about using nested contexts to handle this situations, but what can be done to debug these exceptions when targeting the iOS 4 SDK?
Thanks in advance.
That error comes from a change that can't be merged properly from two contexts. How exactly are you doing your background? You should try the new iOS 5 nested contexts for background saves. The parent can be in a private queue and the child (the background context) is in a thread confinement queue. Saves on the child are pushed up to the master context. After you're done in the background, just save the parent context to persist the changes to disk.
When i try to view MDIParent screen in designer mode I’m getting below exception...
`Could not find endpoint element with name 'NetTcpBinding_IMyService' and contract 'ClientProxy.IMyService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.'
Little background to understand my question more clearly...
I've a WCF server which I’m trying to consume in my Winform application. So i've created a separate class library in which i added service reference and created a proxy. I've copied the client endpoint info from app.config in class library to UI app.config file.
When i run the application everything is working fine but when i try to open MDIParent screen in designer mode its throwing above exception.
Note: I think i'm getting error because i'm trying to create a proxy object on NEW method (form constractor) if i comment that line - i'm able to view designer screen.
Please help :)
Venky
If you instantiate the service in the form's constructor, this could be the source of your problem.
If this is the case, wrap the service initialization in a test for DesignMode:
If Not Me.DesignMode Then
' Initialize service
End If
Update
It turns out that DesignMode is not supported in the constructor.
There are a couple of workarounds to choose from:
1) Use the following instead of the designmode test:
If System.ComponentModel.LicenseManager.UsageMode <> System.ComponentModel.LicenseUsageMode.Designtime Then`
2) Move your initialization code from the constructor into the Form's _load event and then use the DesignMode test.
Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Me.DesignMode Then
' Initialize service
End If
End Sub
In a .NET Compact Framework application we are using ocx media player component written by coppercoins.
The media player launches on a new screen when ever user clicks a button. The media player works well on the first time. When we close the media player form and launch it once again on click of the button, it breaks with the following exception
ExceptionCode: 0xc0000005
ExceptionAddress: <address location>
Can someone tell me how to resolve this issue?
Note: we are disposing the media player form as well as the media player activeX wrapper control when the form is closed. The media player is disposed inside the designer code( using as shown below
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
if (disposing)
{
_axPlayer.Dispose();
_axPlayer = null;
}
base.Dispose(disposing);
}
That probably isn't going to be something you'll be able to fix your side and is an issue for forward to the component designer.
As a work around I would suggest retaining the object reference for the duration of the application and not disposing it. Obviously this blows if it occupies a lot of memory.
this solution helped me to fix the issue Media Player Control for .NET Compact Framework