.NET Compact Framework 3.5应用程序中的随机本机异常 [英] Random native exception from .NET Compact Framework 3.5 application

查看:74
本文介绍了.NET Compact Framework 3.5应用程序中的随机本机异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在.NET 3.5紧凑框架上有一个完全用C#编写的应用程序,它似乎在具有本地异常的随机时刻崩溃.我的应用程序从不记录任何刚刚退出的异常.有时我的应用程序可以运行数小时,或者您可以启动它,而5分钟后它将崩溃!

I have an application written wholly in C# on the .NET 3.5 compact framework that seems to be crashing at random moments with native exceptions. My application never logs any of these exceptions it just quits. Sometimes my application can run for hours or you can start it and 5 minutes later it will crash!

我一直在存储有时生成的转储文件,但是由于我缺少抛出的dll的调试符号(netcfagl3_5.dll),因此难以理解问题所在.错误是访问冲突,但尝试读取WinDbg的输出使我感到沮丧:

I have been storing up the dump files that are sometimes produced but having difficulty understanding what the problem is because I lack debug symbols for the dll that is throwing (netcfagl3_5.dll). The error is an Access Violation but trying to read the output from WinDbg has left me frustrated:

FAULTING_IP: 
netcfagl3_5_7b37d000+152b4
7b3922b4 043092e5 ldr         r3,[r2,#4]

EXCEPTION_RECORD:  ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 7b3922b4 (netcfagl3_5_7b37d000+0x000152b4)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000000
   Parameter[1]: ffffffd4
Attempt to read from address ffffffd4

FAULTING_THREAD:  890fa60a

ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.

EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%08lx referenced memory at 0x%08lx. The memory could not be %s.

EXCEPTION_PARAMETER1:  00000000

EXCEPTION_PARAMETER2:  ffffffd4

READ_ADDRESS:  ffffffd4 

FOLLOWUP_IP: 
netcfagl3_5_7b37d000+152b4
7b3922b4 043092e5 ldr         r3,[r2,#4]

APP:  nk.exe

BUGCHECK_STR:  APPLICATION_FAULT_INVALID_POINTER_READ_ZEROED_STACK

PRIMARY_PROBLEM_CLASS:  INVALID_POINTER_READ

DEFAULT_BUCKET_ID:  INVALID_POINTER_READ

LAST_CONTROL_TRANSFER:  from 7b394094 to 7b3922b4

STACK_TEXT:  
2546ec78 7b394094 : 01d5ebec 890fa60a ffffffd0 ffffffd0 : netcfagl3_5_7b37d000+0x152b4
2546ec84 2551cc4c : 01d5ebec 890fa60a ffffffd0 ffffffd0 : netcfagl3_5_7b37d000+0x17094
2546ec90 7b385280 : 01d5ebec 890fa60a ffffffd0 ffffffd0 : 0x2551cc4c
2546ec9c 7b38536c : 01d5ebec 890fa60a ffffffd0 ffffffd0 : netcfagl3_5_7b37d000+0x8280
2546ece8 7b38eb2c : 01d5ebec 890fa60a ffffffd0 ffffffd0 : netcfagl3_5_7b37d000+0x836c
2546ed20 7b38ed84 : 01d5ebec 890fa60a ffffffd0 ffffffd0 : netcfagl3_5_7b37d000+0x11b2c
2546ed5c 7b38f0c4 : 01d5ebec 890fa60a ffffffd0 ffffffd0 : netcfagl3_5_7b37d000+0x11d84
2546eda4 00000000 : 01d5ebec 890fa60a ffffffd0 ffffffd0 : netcfagl3_5_7b37d000+0x120c4

我在这里有4个转储文件 https://www.dropbox.com/s/9g6zjbxh4ghv5v3/DumpFiles.zip 但我可以得到更多.

I have 4 dump files here https://www.dropbox.com/s/9g6zjbxh4ghv5v3/DumpFiles.zip but I can get more.

作为一个附带的问题,我尝试搜寻互联网以找出netcfagl3_5.dll的调试符号的位置,但成功率有限,因此,如果有人知道在哪里可以找到它们,那将是个好主意.

As as a side question I have tried scouring the internet to find out where the debug symbols are for netcfagl3_5.dll with limited success so if any one know's where they can be found that would be great.

我正在追逐摩托罗拉,因为这似乎更像是ES400设备的问题,有关此问题的任何更新都将在这里进行更新.

I am chasing Motorola as specifically this seems to be more of a problem with the ES400 device and any updates from them regarding this problem I will update here.

任何帮助将不胜感激.

推荐答案

在调试了许多小时之后,我相信我已经成功地复制了该问题,从而在我的应用程序中找到了原因.

After many hours of debugging the issue I believe I have managed to replicate the issue thus identify the cause in my application.

我在每个窗体的顶部都有一个TitleBar控件,它显示当前窗体标题,电池状态以及与服务器的当前同步状态.

I have a TitleBar control that is placed on top of every form, this shows the current Form title, the battery status and status of the current synchronization with our server.

该控件订阅我们的同步引擎公开的事件以获取最新状态.引发此事件后,我们将使用图标更新控件以显示其进度.

The control subscribes to an event exposed by our synchronization engine to get the latest state. When this event is raised we update the control with an icon to show its progress.

我遵守有关跨线程访问的所有规则,并确保仅使用UI线程来操纵控件,但是似乎如果我们不断获取状态更改,则会在内部导致AccessViolation.

I follow all the rules regarding cross thread access and making sure the control is only manipulated using the UI thread but it seems that if we constantly get state changes something internally causes an AccessViolation.

如果我使用Timer并每隔几秒钟更新一次控件,而不是在状态更改时更新一次,问题就会消失,并且我们不再会出现随机进程退出的情况.

If I use a Timer and update the control every couple of seconds rather than when the state has changed the problem goes away and we no longer get random process exits.

上面的堆栈跟踪的关键部分对netcfagl3_5是Windows Forms本机dll的事实比其他任何事情都有用,因此所有这些难题似乎都融合在一起了.

The crucial part of the stack trace above that helps more than anything else is the fact the netcfagl3_5 is a Windows Forms native dll so the bits of the puzzle all seem to be coming together.

这篇关于.NET Compact Framework 3.5应用程序中的随机本机异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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