- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我有一个 Winform 应用程序 (C#),它从 dll 导入一些函数。
有时在运行应用程序时会出现以下异常:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
我在 AppDomain.CurrentDomain.UnhandledException
中捕获了它。
所以我尝试用 WinDbg 调试它。我能够捕获异常并获得以下输出:
!analyze -v
FAULTING_IP:
KERNEL32!SetErrorMode+14b
77e6c427 8a08 mov cl,byte ptr [eax]
EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 77e6c427 (KERNEL32!SetErrorMode+0x0000014b)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000000
Parameter[1]: 087deadc
Attempt to read from address 087deadc
FAULTING_THREAD: 00000b1c
PROCESS_NAME: App.exe
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: 087deadc
READ_ADDRESS: 087deadc
FOLLOWUP_IP:
KERNEL32!SetErrorMode+14b
77e6c427 8a08 mov cl,byte ptr [eax]
NTGLOBALFLAG: 0
APPLICATION_VERIFIER_FLAGS: 0
MANAGED_STACK: !dumpstack -EE
OS Thread Id: 0xb1c (34)
Current frame:
ChildEBP RetAddr Caller,Callee
ADDITIONAL_DEBUG_TEXT: Followup set based on attribute [UnloadedModule_Arch_AX] from Frame:[0] on thread:[b1c] ; Enable Pageheap/AutoVerifer
DEFAULT_BUCKET_ID: HEAP_CORRUPTION
PRIMARY_PROBLEM_CLASS: HEAP_CORRUPTION
BUGCHECK_STR: APPLICATION_FAULT_HEAP_CORRUPTION_INVALID_POINTER_READ
LAST_CONTROL_TRANSFER: from 7a0aa797 to 77e6c427
STACK_TEXT:
WARNING: Stack unwind information not available. Following frames may be wrong.
08bddc6c 7a0aa797 00000000 00000001 087deadc KERNEL32!SetErrorMode+0x14b
08bddd68 7c82a124 056306e8 08bddf9c 7c82a0b8 mscorwks!CorLaunchApplication+0x281f8
08bddd74 7c82a0b8 7c82a0fc 00000001 00000004 ntdll!RtlpAllocateFromHeapLookaside+0x13
08bddf9c 00000000 00000000 00000000 00000000 ntdll!RtlAllocateHeap+0x1dd
STACK_COMMAND: .ecxr ; ~~[b1c] ; .frame 0 ; ~34s ; kb
SYMBOL_NAME: ure.dll!Unloaded
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: ure.dll
IMAGE_NAME: ure.dll
DEBUG_FLR_IMAGE_TIMESTAMP: 750063
FAILURE_BUCKET_ID: HEAP_CORRUPTION_c0000005_ure.dll!Unloaded
BUCKET_ID: APPLICATION_FAULT_HEAP_CORRUPTION_INVALID_POINTER_READ_ure.dll!Unloaded
WATSON_STAGEONE_URL: http://watson.microsoft.com/StageOne/App_exe/1_2009_403_12/49e707a9/KERNEL32_dll/5_2_3790_4062/46264680/c0000005/0002c427.htm?Retriage=1
Followup: MachineOwner
这是什么意思?我应该用它做什么?
提前感谢任何提示!!
最佳答案
看起来 ure.dll
已被卸载,调用
NlsAnsiToUnicode
MultiByteToWideChar() 引用它失败。您可以在 !analyze -v
之前运行 .symfix
来确认这一点。
那是您要导入的 DLL 吗?如果不是,你有内存损坏。否则,错误可能在该 DLL 中。您是否使用 P/Invoke 导入它?
是的,卸载的 DLL 信息已损坏。您可能会猜到,它是 .NET 的 culture.dll
,Windbg 正在读取其中的“邪教”部分作为时间戳和校验和。尝试重新启动并执行以下操作:
.symfix
sxe ud
g
当断点命中时:
kb
(这是告诉 Windbg 运行直到 DLL 被卸载,然后转储堆栈)
运行一下让模块卸载,然后执行下面的命令。然后让 Windbg 运行,直到你得到异常,再次执行这个命令来比较:
db ntdll!RtlpUnloadEventTrace
(这是已损坏的卸载模块表的开头。)
关于c# - 了解 WinDbg 输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/759365/
我正在尝试分析一些小型故障转储。我使用的是 Windows 10 Pro Build 1607 和 WinDbg 10.0.14321.1024。我的符号文件路径设置为 SRV*C:\SymCache
我正在尝试追踪谁在进行特定大小的分配,我尝试使用用户模式堆栈跟踪数据库 (gflags +ust),但由于 FPO,我无法看到整个堆栈。因此,我想在 RtlAllocateHeap 达到我正在寻找的分
是否可以搜索整个可执行内存空间以找到调用特定方法的所有位置?例如,我想从调用 MyApplcation!MyFunction 的位置查找所有函数。使用“s”命令搜索特定的 optcode 不是一个选项
我在我的程序中遇到了一个 stackoverflow 异常,它可能来自第三方库 microsoft.sharepoint.client.runtime.dll。 使用 adplus 创建故障转储,我面
是否有任何扩展命令可以这样做?我只想包含所有参数的整个命令行。 最佳答案 命令行参数等信息存储在 PEB 中(进程环境块)。 您可以找到 a list of common commands here.
在 OllyDbg 中,它允许你运行直到返回,例如你遇到了 ret或 leave操作说明。 WinDbg 支持吗?我在菜单中没有找到这样的功能。 最佳答案 如果您想在返回之前停止,可以使用pt .如果
我正在尝试使用 d* 命令评估 WindDbg 中调用堆栈的内容。我知道我要转储的数据的地址是 [ebp+8] .但是,当使用此命令时,WinDbg 以 8 字节偏移量在 ebp 处转储数据。我想转储
有没有办法告诉 WinDbg 忽略由 DebugBreak function 引起的程序断点? 最佳答案 看看 Controlling Exceptions and Events MSDN 上的页面。
我尝试在 c# 应用程序的源代码中使用 WinDbg 设置断点,但没有成功。 当我使用 WinDbg 时,有没有办法在托管应用程序的源代码处设置断点? 复制步骤如下: 1.制作一个简单的c#应用程序
我正在尝试使用 WinDBG 检查可执行文件的程序集,但我很难找到它。我想在程序的第一条指令处设置断点,但是当我尝试手动执行此操作(使用模块的地址)时,WinDBG 告诉我它“无法在该位置插入断点”,
我正在逆向一个 win32 应用程序。 问题: 调试程序时。我发现计数器曾经跳转到地址 0x0043D4A0。 (这是一个函数入口点)。 0043D4A0 51 P
作为驱动程序开发人员,WinDbg 是我最好的 friend 之一。 现在从 Windows 8 开始,我安装了新的 WDK 并想使用它的新 WinDbg。它具有一些不错的功能,例如通过网络进行远程调
我需要调试在 Windows 上运行的正在运行的程序。它有时会因“内存访问冲突”而崩溃。 使用 windbg(无法使用 IDE)我附加到正在运行的进程(这是程序不得停止的要求) 命令行是 windbg
我正在调查 WinDBG 中的 Windows 转储文件。我可以通过命令 .frame 切换调用堆栈帧,但我发现寄存器始终包含最后一个上下文。我的意思是,是否可以恢复属于非顶级调用堆栈帧的特定调用堆栈
我正在调试一个模块,该模块只有 .exe 和 .pdb,没有私有(private)符号。 在调试 session 期间,我需要检查内部结构。显然这个结构不会出现在 PDB 中,因为它是私有(priva
Intel Power Gadget该工具无法在我的系统上运行,我正试图找出原因。它是运行 Window 8.1 x64 的 Core i7-720QM。 AIDA64 可以很好地读取 CPU 温度,
我在程序中遇到访问冲突。 Windbg 显示程序正在尝试读取 0x09015000 .它在地址旁边显示问号 ( ?? )。我的问题是,这些问号表示什么。它们是否意味着从未分配过内存位置,即它不受任何物
如何将命令窗口的内容直接保存到日志文件中而不在WinDbg的命令窗口显示这些内容? 最佳答案 假设您还不知道这一点,您可以使用 -log{o|a} windbg command line选项来指定您希
我使用的是 WinDBG 6.12.0002.633 X86。 我遇到了命令行调试器 CDB 的问题,它没有显示与 k 的 WinDBG 相同的结果。和 kL命令。 在 WinDBG 中,k命令正确显
我正在开发一个 32 位应用程序,它有时会导致某些 64 位 Windows 7 机器崩溃。我使用 Sysinternals 的 ProcDump 实用程序生成了崩溃的转储文件。 (我使用了命令“pr
我是一名优秀的程序员,十分优秀!