Advanced Debugging
About AdvDbg Consult Train Services Products Tools Community Contact  
欢迎光临 高端调试 登录 | 注册 | FAQ
 
  ACPI调试
Linux内核调试
Windows内核调试
 
  调试战役
调试原理
新工具观察
 
  Linux
Windows Vista
Windows
 
  Linux驱动
WDF
WDM
 
  PCI Express
PCI/PCI-X
USB
无线通信协议
 
  64位CPU
ARM
IA-32
  CPU Info Center
 
  ACPI标准
系统认证
Desktop
服务器
 
  Embedded Linux
嵌入式开发工具
VxWorks
WinCE
嵌入式Windows
 
  格蠹调试套件(GDK)
  格蠹学院
  小朱书店
  老雷的微博
  《软件调试》
  《格蠹汇编》
  《软件调试(第二版)》
沪ICP备11027180号-1

C/C++本地代码调试

帖子发起人: frankiewang008   发起时间: 2013-05-30 10:42 上午   回复: 4

Print Search
帖子排序:    
   2013-05-30, 10:42 上午
frankiewang008 离线,最后访问时间: 2013/5/30 2:05:09 frankiewang008

发帖数前200位
注册: 2013-05-30
发 贴: 6
mshtml.dll 和 jscript.dll导致的NTDLL.dll报错
Reply Quote
各位高手,我这边IE6调取我自己开发的一个OCX,存在IE突然爆掉的现象,我打印DUMP文件,并通过WinDbug进行Analyze之后显示如下,请帮忙分析下是不是我的ocx爆出的异常还是说是HTML内部源码出的问题。

步骤一:

 0:007> !analyze -v 
FAULTING_IP: 
ntdll!RtlFreeHeap+44e
7c949f07 8b11            mov     edx,dword ptr [ecx]

EXCEPTION_RECORD:  ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 7c949f07 (ntdll!RtlFreeHeap+0x0000044e)
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 00000000
   Parameter[1]: 00000064
Attempt to read from address 00000064

PROCESS_NAME:  iexplore.exe

ERROR_CODE: (NTSTATUS) 0xc0000005 - "0x%08lx"

EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - "0x%08lx"

EXCEPTION_PARAMETER1:  00000000

EXCEPTION_PARAMETER2:  00000064

READ_ADDRESS:  00000064 

FOLLOWUP_IP: 
ntdll!RtlFreeHeap+44e
7c949f07 8b11            mov     edx,dword ptr [ecx]

ADDITIONAL_DEBUG_TEXT:  Enable Pageheap/AutoVerifer

FAULTING_THREAD:  000001ec

BUGCHECK_STR:  APPLICATION_FAULT_HEAP_CORRUPTION_NULL_CLASS_PTR_DEREFERENCE_INVALID_POINTER_WRITE_INVALID_POINTER_READ

PRIMARY_PROBLEM_CLASS:  HEAP_CORRUPTION_INVALID_POINTER_WRITE

DEFAULT_BUCKET_ID:  HEAP_CORRUPTION_INVALID_POINTER_WRITE

LAST_CONTROL_TRANSFER:  from 769acfdc to 7c949f07

STACK_TEXT:  
019adb84 769acfdc 00150000 00000000 0c84ae30 ntdll!RtlFreeHeap+0x44e
019adb98 770f4af8 76ab7034 0c84ae30 0017d8e0 ole32!CRetailMalloc_Free+0x1c
019adbb8 770f4abb 0c84ae30 00000010 00000008 oleaut32!APP_DATA::FreeCachedMem+0xa0
019adbd4 770f4b13 0c84ae34 0a462ce0 80004005 oleaut32!SysFreeString+0x6b
019adbe8 3eec8978 0a462ce0 009aeda8 00000001 oleaut32!VariantClear+0xbb
019adbfc 3e365697 0a462ce0 00000001 3e364b84 ieframe!Detour_VariantClear+0x2f
019adce0 77d18734 002d0504 00000a75 0000235a jscript!VAR::Clear+0x91
019add0c 77d18816 3db5525a 002d0504 00000113 user32!InternalCallWinProc+0x28
019add74 77d189cd 00000000 3db5525a 002d0504 user32!UserCallWinProcCheckWow+0x150
019addd4 77d18a10 019ade08 00000000 019afeec user32!DispatchMessageWorker+0x306
019adde4 3edcc2c5 019ade08 00000000 009a8b48 user32!DispatchMessageW+0xf
019afeec 3ed7330f 0020dfc8 001d9968 00151f80 ieframe!CTabWindow::_TabWindowThreadProc+0x54c
019affa4 3ec18061 009a8b48 00000020 019affec ieframe!LCIETab_ThreadProc+0x2c1
019affb4 7c80b729 00151f80 001d9968 00000020 iertutil!CIsoScope::RegisterThread+0xab
019affec 00000000 3ec18053 00151f80 00000000 kernel32!BaseThreadStart+0x37


SYMBOL_NAME:  heap_corruption!heap_corruption

FOLLOWUP_NAME:  MachineOwner

MODULE_NAME: heap_corruption

IMAGE_NAME:  heap_corruption

DEBUG_FLR_IMAGE_TIMESTAMP:  0

STACK_COMMAND:  .cxr 00000000 ; kb ; ~7s; .ecxr ; kb

FAILURE_BUCKET_ID:  HEAP_CORRUPTION_INVALID_POINTER_WRITE_c0000005_heap_corruption!heap_corruption

BUCKET_ID:  APPLICATION_FAULT_HEAP_CORRUPTION_NULL_CLASS_PTR_DEREFERENCE_INVALID_POINTER_WRITE_INVALID_POINTER_READ_heap_corruption!heap_corruption

WATSON_IBUCKET:  -1992496523

WATSON_IBUCKETTABLE:  1

WATSON_STAGEONE_URL:  http://watson.microsoft.com/StageOne/iexplore_exe/8_0_6001_18702/49b3ad2e/ntdll_dll/5_1_2600_6055/4d00f280/c0000005/00029f07.htm?Retriage=1

Followup: MachineOwner

 
步骤二:
 
0:007>  k
ChildEBP RetAddr  
019ac964 7c92d18a ntdll!KiFastSystemCallRet
019ac968 7c8094e5 ntdll!NtCreateSection+0xc
019ac9f4 7c92cffa kernel32!CreateFileMappingW+0x10b
019aca14 68d8de20 ntdll!ZwClose+0xc
019acb48 012b0000 dbghelp!Win32LiveSystemProvider::OpenMapping+0x228
WARNING: Frame IP not in any known module. Following frames may be wrong.
019acbac 7c957302 0x12b0000
019acbf0 7c957585 ntdll!RtlpLowFragHeapFree+0xa7
019acc30 7c956fa1 ntdll!RtlpSubSegmentInitialize+0x126
019acd08 7c9301db ntdll!RtlpLowFragHeapAlloc+0x8fa
7c956d80 90909090 ntdll!RtlAllocateHeap+0xeac
7c956d90 ffffffff 0x90909090
7c970768 65d6e9ff 0xffffffff
7c97076c 7980fffe 0x65d6e9ff
7c970770 1775ff07 0x7980fffe
7c970774 eec1f18b 0x1775ff07
7c970778 33198b03 0xeec1f18b
7c97077c 33f033f3 0x33198b03
7c970780 99e0e435 0x33f033f3
7c970784 76b70f7c 0x99e0e435
7c970788 0f03eb10 0x76b70f7c
0:007> k 100
ChildEBP RetAddr  
019ac964 7c92d18a ntdll!KiFastSystemCallRet
019ac968 7c8094e5 ntdll!NtCreateSection+0xc
019ac9f4 7c92cffa kernel32!CreateFileMappingW+0x10b
019aca14 68d8de20 ntdll!ZwClose+0xc
019acb48 012b0000 dbghelp!Win32LiveSystemProvider::OpenMapping+0x228
WARNING: Frame IP not in any known module. Following frames may be wrong.
019acbac 7c957302 0x12b0000
019acbf0 7c957585 ntdll!RtlpLowFragHeapFree+0xa7
019acc30 7c956fa1 ntdll!RtlpSubSegmentInitialize+0x126
019acd08 7c9301db ntdll!RtlpLowFragHeapAlloc+0x8fa
7c956d80 90909090 ntdll!RtlAllocateHeap+0xeac
7c956d90 ffffffff 0x90909090
7c970768 65d6e9ff 0xffffffff
7c97076c 7980fffe 0x65d6e9ff
7c970770 1775ff07 0x7980fffe





IP 地址: 已记录   报告
   2013-05-30, 12:43 下午
Raymond 离线,最后访问时间: 2020/7/3 3:40:25 格蠹老雷

发帖数前10位
注册: 2005-12-19
发 贴: 1,303
Re: mshtml.dll 和 jscript.dll导致的NTDLL.dll报错
Reply Quote

堆被破坏了

1)检查代码中的内存分配和释放(new, delete, malloc, free...)

2)启用堆的调试支持,Google或者参考《软件调试》23.6


IP 地址: 已记录   报告
   2013-05-30, 13:57 下午
frankiewang008 离线,最后访问时间: 2013/5/30 2:05:09 frankiewang008

发帖数前200位
注册: 2013-05-30
发 贴: 6
Re: mshtml.dll 和 jscript.dll导致的NTDLL.dll报错
Reply Quote
从这里能看出是什么地方导致内存破坏的吗?
IP 地址: 已记录   报告
   2013-05-31, 11:58 上午
hellokit 离线,最后访问时间: 2014/8/8 4:06:51 josh

发帖数前200位
注册: 2012-12-21
发 贴: 6
Re: mshtml.dll 和 jscript.dll导致的NTDLL.dll报错
Reply Quote
019adb84 769acfdc 00150000 00000000 0c84ae30 ntdll!RtlFreeHeap+0x44e
楼主看下RtlFreeHeap(Heap,FLAG,Address) = RtlFreeHeap(00150000,000000,0c84ae30)
看样子这个栈还是可信的,出现在进程堆150000的c84ae30上发生了释放错误,
我猜测,可能是二次释放造成的,变体变量中的字符串成员估计是BSTR字符串出现的问题,
还有一点楼主你自己的程序把符号挂好啊.
以上自己的一点想法,希望有用

IP 地址: 已记录   报告
   2013-05-31, 13:44 下午
frankiewang008 离线,最后访问时间: 2013/5/30 2:05:09 frankiewang008

发帖数前200位
注册: 2013-05-30
发 贴: 6
Re: mshtml.dll 和 jscript.dll导致的NTDLL.dll报错
Reply Quote
我只有OCX的程序,网页源码没有在我这边,我现在怀疑是网页源码导致的内存错误。OCX的PDB文件我都挂上的,但是没有显示OCX相关的组件有问题。
IP 地址: 已记录   报告
高端调试 » 软件调试 » C/C++本地代码调试 » Re: mshtml.dll 和 jscript.dll导致的NTDLL.dll报错

 
Legal Notice Privacy Statement Corporate Governance Corporate Governance
(C)2004-2020 ADVDBG.ORG All Rights Reserved.