C# 在NullReference异常之后接收访问冲突异常(0xc0000005)是否正常

C# 在NullReference异常之后接收访问冲突异常(0xc0000005)是否正常,c#,.net,clr,C#,.net,Clr,我试图解决的一个大问题是确定为什么在我们的一个托管应用程序中,我们会不时收到访问冲突异常(0xc0000005)。 最近,在一个完全不同的应用程序上,我们开始收到一个NullReference异常(这是一个已知的bug),但随后出现了一个(0xc0000005)错误。我不知道这是正常行为还是与我们的“大问题”有关 访问冲突异常(第二) 空引用异常(第1个) 应用程序:Marketform.Ultimates.Client.exe 框架版本:v4.0.30319 描述:由于未处理的异常,进程已终止

我试图解决的一个大问题是确定为什么在我们的一个托管应用程序中,我们会不时收到访问冲突异常(0xc0000005)。 最近,在一个完全不同的应用程序上,我们开始收到一个NullReference异常(这是一个已知的bug),但随后出现了一个(0xc0000005)错误。我不知道这是正常行为还是与我们的“大问题”有关

访问冲突异常(第二)

空引用异常(第1个)

应用程序:Marketform.Ultimates.Client.exe
框架版本:v4.0.30319
描述:由于未处理的异常,进程已终止。
异常信息:System.NullReferenceException
堆栈:
在Marketform.Ultimates.Module.ViewModels.UltimatePremiumViewModel.CanSave()中
在Microsoft.Practices.Prism.Commands.DelegateCommand+c__DisplayClass6.b__3(System.Object)上
在Microsoft.Practices.Prism.Commands.DelegateCommandBase.CanExecute(System.Object)中
在Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.CanExecute(System.Object)中
在Marketform.Ultimates.Module.DelegateCommandWrapper.CanExecute(System.Object)上
位于MS.Internal.Commands.CommandHelpers.CanExecuteCommandSource(System.Windows.Input.ICommandSource)
在System.Windows.Controls.Primitives.ButtonBase.UpdateCanExecute()中
位于System.Windows.Controls.Primitives.ButtonBase.HookCommand(System.Windows.Input.ICommand)
在System.Windows.Controls.Primitives.ButtonBase.OnCommand中更改(System.Windows.DependencyObject、System.Windows.DependencyPropertyChangedEventArgs)
位于System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
位于System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
位于System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
位于System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex、System.Windows.DependencyProperty、System.Windows.PropertyMetadata、System.Windows.EffectiveValueEntry、System.Windows.EffectiveValueEntry ByRef、Boolean、Boolean、System.Windows.OperationType)
位于System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty)
位于System.Windows.Data.BindingExpressionBase.Invalidate(布尔值)
位于System.Windows.Data.BindingExpression.TransferValue(System.Object,布尔值)
位于System.Windows.Data.BindingExpression.Activate(System.Object)
位于System.Windows.Data.BindingExpression.AttachToContext(AttachateMPT)
位于System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(布尔值)
在MS.Internal.Data.DataBindEngine+Task.Run处(布尔值)
在MS.Internal.Data.DataBindEngine.Run(System.Object)处
位于System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate、System.Object、Int32)
位于MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object、System.Delegate、System.Object、Int32、System.Delegate)
在System.Windows.Threading.DispatcherOperation.InvokeImpl()中
位于System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
位于System.Threading.ExecutionContext.runTryCode(System.Object)
在System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuarantedCleanup(TryCode,CleanupCode,System.Object)中
位于System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext、System.Threading.ContextCallback、System.Object)
在System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,布尔值)
在System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object)上运行
在System.Windows.Threading.DispatcherOperation.Invoke()中
在System.Windows.Threading.Dispatcher.ProcessQueue()中
位于System.Windows.Threading.Dispatcher.WndProcHook(IntPtr、Int32、IntPtr、IntPtr、Boolean ByRef)
位于MS.Win32.hwndwapper.WndProc(IntPtr、Int32、IntPtr、IntPtr、Boolean ByRef)
位于MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
位于System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate、System.Object、Int32)
位于MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object、System.Delegate、System.Object、Int32、System.Delegate)
位于System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority,System.TimeSpan,System.Delegate,System.Object,Int32)
在MS.Win32.HwndSubclass.SubclassWndProc(IntPtr,Int32,IntPtr,IntPtr)
位于MS.Win32.unsafentivemethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
位于System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
位于System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
位于System.Windows.Application.RunDispatcher(System.Object)
位于System.Windows.Application.RunInternal(System.Windows.Window)
在System.Windows.Application.Run(System.Windows.Window)中
在Marketform.Ultimates.Client.App.Main()上

是的,这很正常。Windows中不存在“空引用异常”。此类指针故障由处理器报告,并带有通用保护故障陷阱,该陷阱在操作系统中生成访问冲突异常。异常代码0xc0000005

Windows设置进程的虚拟内存时始终保留底部64KB,从地址0开始未映射。特别是为了检测指针错误,它们在编程中非常常见。因此,空指针将始终触发处理器故障。以及稍大于0的地址,当程序试图通过空指针访问对象的字段时生成

CLR截获本机访问冲突异常,并查看导致异常的地址
Faulting application name: Marketform.Ultimates.Client.exe, version: 0.27.0.0, time stamp: 0x52728ad4
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x08cac78a
Faulting process id: 0x10f4
Faulting application start time: 0x01ced7016881cca1
Faulting application path: C:\Users\vxk\AppData\Local\Apps\2.0\WZ2LJT6T.PKK\WEJ4X8PL.17E\mark..tion_5585060aa30c4020_0000.001e_06d3070c7f40068c\Marketform.Ultimates.Client.exe
Faulting module path: unknown
Report Id: b7d08351-42f4-11e3-802a-005056b87be9
Application: Marketform.Ultimates.Client.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
Stack:
   at Marketform.Ultimates.Module.ViewModels.UltimatePremiumViewModel.CanSave()
   at Microsoft.Practices.Prism.Commands.DelegateCommand+<>c__DisplayClass6.<.ctor>b__3(System.Object)
   at Microsoft.Practices.Prism.Commands.DelegateCommandBase.CanExecute(System.Object)
   at Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.CanExecute(System.Object)
   at Marketform.Ultimates.Module.DelegateCommandWrapper.CanExecute(System.Object)
   at MS.Internal.Commands.CommandHelpers.CanExecuteCommandSource(System.Windows.Input.ICommandSource)
   at System.Windows.Controls.Primitives.ButtonBase.UpdateCanExecute()
   at System.Windows.Controls.Primitives.ButtonBase.HookCommand(System.Windows.Input.ICommand)
   at System.Windows.Controls.Primitives.ButtonBase.OnCommandChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
   at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
   at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
   at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
   at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
   at System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty)
   at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean)
   at System.Windows.Data.BindingExpression.TransferValue(System.Object, Boolean)
   at System.Windows.Data.BindingExpression.Activate(System.Object)
   at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt)
   at System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean)
   at MS.Internal.Data.DataBindEngine+Task.Run(Boolean)
   at MS.Internal.Data.DataBindEngine.Run(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
   at System.Threading.ExecutionContext.runTryCode(System.Object)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   at System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
   at System.Windows.Application.RunDispatcher(System.Object)
   at System.Windows.Application.RunInternal(System.Windows.Window)
   at System.Windows.Application.Run(System.Windows.Window)
   at Marketform.Ultimates.Client.App.Main()