WPF程序崩溃,Window日志分析

miracle1111 2021-01-20 11:33:44
WPF程序运行一段时间崩溃,有全局异常捕获,但是捕获不到。
在windows事件管理器找到如下记录,求大佬分析一下

应用程序: PCDemo.exe
Framework 版本: v4.0.30319
说明: 由于未经处理的异常,进程终止。
异常信息: 异常代码为 c0000005,异常地址为 6A428C61
堆栈:
在 System.Windows.Forms.UnsafeNativeMethods.IntDestroyWindow(System.Runtime.InteropServices.HandleRef)
在 System.Windows.Forms.UnsafeNativeMethods.DestroyWindow(System.Runtime.InteropServices.HandleRef)
在 System.Windows.Forms.NativeWindow.DestroyHandle()
在 System.Windows.Forms.Control.DestroyHandle()
在 System.Windows.Forms.Control.Dispose(Boolean)
在 System.Windows.Forms.Integration.WinFormsAdapter.Dispose(Boolean)
在 System.ComponentModel.Component.Dispose()
在 System.Windows.Forms.Integration.WindowsFormsHost.DestroyWindowCore(System.Runtime.InteropServices.HandleRef)
在 System.Windows.Interop.HwndHost.DestroyWindow()
在 System.Windows.Interop.HwndHost.Dispose(Boolean)
在 System.Windows.Forms.Integration.WindowsFormsHost.Dispose(Boolean)
在 System.Windows.Interop.HwndHost+WeakEventDispatcherShutdown.OnShutdownFinished(System.Object, System.EventArgs)
在 System.EventHandler.Invoke(System.Object, System.EventArgs)
在 System.Windows.Threading.Dispatcher.ShutdownImplInSecurityContext(System.Object)
在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
在 MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
在 System.Windows.Threading.Dispatcher.ShutdownImpl()
在 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)
在PCDemo.App.Main()
...全文
489 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
miracle1111 2021-01-20
  • 打赏
  • 举报
回复
程序里使用了Winform的PictureBox的句柄,PM101DA.dll通过句柄在Picturebox上显示画面
miracle1111 2021-01-20
  • 打赏
  • 举报
回复
还有一个 错误应用程序名称: PCDemo.exe,版本: 1.0.0.0,时间戳: 0xf11baba3 错误模块名称: PM101DA.dll,版本: 4.1.404.6,时间戳: 0x5f372c65 异常代码: 0xc0000005 错误偏移量: 0x00008c61 错误进程 ID: 0xe508 错误应用程序启动时间: 0x01d6ea837df46e54 错误应用程序路径: C:\Release\PCDemo 错误模块路径: C:\Release\Dll\PM101DA.dll 报告 ID: a230aef2-e56c-496d-b6ea-6d3146551283 错误程序包全名:
JDD1997 2021-01-20
  • 打赏
  • 举报
回复
1 是如何捕获全局变量的? 2 是否使用了非托管功能?
wanghui0380 2021-01-20
  • 打赏
  • 举报
回复
ps:建议在 Dispose里去做释放动作,比如停止录制,停止渲染等动作。 也可以把handle提升成class的成员,这样class Dispose前至少不会发生异常
miracle1111 2021-01-20
  • 打赏
  • 举报
回复
引用 5 楼 wanghui0380 的回复:
此异常为SEH异常(也就是未映射异常),默认不能捕获。 除非你自己显示捕获,有关此处问题清自己百度“C# SEHException”
好的,感谢大佬,我去查一下资料
wanghui0380 2021-01-20
  • 打赏
  • 举报
回复
此异常为SEH异常(也就是未映射异常),默认不能捕获。 除非你自己显示捕获,有关此处问题清自己百度“C# SEHException”
miracle1111 2021-01-20
  • 打赏
  • 举报
回复
引用 3 楼 wanghui0380 的回复:
Form 退出未做 非托管清理,导致PM101DA.dll在后台刷新访问时,访问了已释放的句柄
这个异常捕获不到吗?,我有做全局的异常捕获。在包含PictureBox的Usercontrol Unloaded时做了清理工作。难道时PM101DA.dll内部的问题?
wanghui0380 2021-01-20
  • 打赏
  • 举报
回复
Form 退出未做 非托管清理,导致PM101DA.dll在后台刷新访问时,访问了已释放的句柄

110,502

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧