当前位置: 首页 > news >正文

windbg-记一次应用程序崩溃的定位

Windbg 及sos.dll、mex.dll扩展插件-CSDN博客

windbg设置见上

查看内存信息如下,发现是创建句柄时异常

Current frame: KERNELBASE!RaiseException+0x69
0:035> !DumpStack
OS Thread Id: 0x2af4 (35)
Current frame: KERNELBASE!RaiseException+0x69
Child-SP         RetAddr          Caller, Callee
000000002f1ce570 00007ff91ed8563e clr!GCCoop::GCCoop+0xe, calling clr!GetTLSDummy
000000002f1ce580 00007ff91edf9c1c clr!IsExceptionOfType+0x14, calling clr!Object::GetTrueMethodTable
000000002f1ce5f0 00007ff91edb8aee clr!StringLiteralMap::GetStringLiteral+0x221, calling clr!CrstBase::Leave
000000002f1ce6d0 00007ff91edfb4a4 clr!IL_Throw+0x114, calling clr!RaiseTheExceptionInternalOnly
000000002f1ce868 00007ff91edfb3d5 clr!IL_Throw+0x45, calling clr!LazyMachStateCaptureState
000000002f1ce9f0 00007ff8f6453827 (MethodDesc 00007ff8f6281bc0 System.Windows.Forms.Timer+TimerNativeWindow.EnsureHandle())
000000002f1cea58 00007ff91ef08e45 clr!JIT_NewCrossContext_Portable+0x75, calling clr!LazyMachStateCaptureState
000000002f1cea90 00007ff8f6453644 (MethodDesc 00007ff8f61b5608 System.Windows.Forms.Timer.set_Enabled(Boolean)), calling 00007ff8c0ef7900
000000002f1ceb20 00007ff8c28b88ba (MethodDesc 00007ff8c2c44300 +0x8a DevExpress.XtraSplashScreen.OverlayLayeredWindow.RunMessageLoop())
000000002f1ceb90 00007ff8c28b3f70 (MethodDesc 00007ff8c2c44188 +0xf0 DevExpress.XtraSplashScreen.OverlayLayeredWindow.Show())
000000002f1cebe0 00007ff8c28b3a27 (MethodDesc 00007ff8c2c43960 +0x47 DevExpress.XtraSplashScreen.OverlayWindowController.DoShow()), calling 00007ff8c28b0bb8
000000002f1cec20 00007ff91a33df12 (MethodDesc 00007ff919db85b8 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean))
000000002f1cecf0 00007ff91a33dd95 (MethodDesc 00007ff919f987a0 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)), calling (MethodDesc 00007ff919db85b8 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean))
000000002f1ced30 00007ff937807997 ntdll!RtlDeactivateActivationContextUnsafeFast+0xc7, calling ntdll!_security_check_cookie
000000002f1ced90 00007ff91ed87255 clr!SigPointer::PeekElemTypeNormalized+0x32, calling clr!SigPointer::PeekElemTypeClosed
...
000000002f1cfbf0 00007ff93781cec1 ntdll!RtlUserThreadStart+0x21, calling ntdll!guard_dispatch_icall_nop

列出所有按 callstack 线程分组的线程、发现一个奇怪的线程  

0000000180167de2 QQPinyin+0x167de2
0:035> !mex.us
...

1 thread [stats]: 8
    00007ff93786b414 ntdll!NtDelayExecution+0x14
    00007ff9350f818e KERNELBASE!SleepEx+0x9e
    0000000180167de2 QQPinyin+0x167de2
    000000002af4c8b8 0x2af4c8b8

...

18 stack(s) with 36 threads displayed (36 Total threads)

查看线程堆栈

0:035> !mex.t 8
DbgID ThreadID       User Kernel Create Time (UTC)
8     286c (0n10348)    0   46ms xx/xx/xxxx 01:25:43.673 上午

# Child-SP         Return           Call Site
0 000000002caefd28 00007ff9350f818e ntdll!NtDelayExecution+0x14
1 000000002caefd30 0000000180167de2 KERNELBASE!SleepEx+0x9e
2 000000002caefdd0 000000002af4c8b8 QQPinyin+0x167de2
3 000000002caefdd8 0000000000000000 0x2af4c8b8

然后我有查看所有线程 没看到线程id为0x286c这个线程很奇怪

0:008> !threads
ThreadCount:      26
UnstartedThread:  0
BackgroundThread: 22
PendingThread:    0
DeadThread:       3
Hosted Runtime:   no
                                                                                                        Lock  
       ID OSID ThreadOBJ           State GC Mode     GC Alloc Context                  Domain           Count Apt Exception
   0    1  8a4 0000000000eaf7b0    26020 Cooperative 0000000065836A70:0000000065836FD0 0000000000ea2cd0 1     Ukn 
   2    2  b74 0000000000ed9940    2b220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Finalizer) 
XXXX    3    0 000000001bb5e630  1039820 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
XXXX    4    0 000000001bac0f70  1039820 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
   4    7 2174 000000001fbea540  102a220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
   5   13  b20 000000001fcdb2b0    2b220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn 
   6   14 27e4 000000001fcdba80    2b220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn 
   7   15 1940 000000001fcf32c0    2b220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn 
  10   17 2788 0000000023ce27f0  202b220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 1     Ukn 
  11   22  630 0000000023ce08b0  1020220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
  20   44 2110 000000003392d0d0  1029220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
  21   48 1cac 00000000337c2f70  1029220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
  22   27 16e4 000000003392d8a0  1029220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
  23   41  ff4 00000000337c1fd0  1029220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
  24   30 2d44 0000000023ce5ea0  1029220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
  25   10 2fac 0000000033ccef30  1029220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
  26   12 2744 000000003cb97840  1029220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
  27   49 2d0c 0000000033ccfed0  1029220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
  28   45 2f18 00000000536f9cc0  1029220 Preemptive  00000000652CABC0:00000000652CCAD8 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
  29   34 25e8 0000000033ccdf90  1029220 Preemptive  00000000652CCC58:00000000652CEAD8 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
  30   18 2c58 0000000033546aa0  8029220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Completion Port) 
  31   51 2c30 00000000334ef340  1029220 Preemptive  00000000652CEB08:00000000652D0AD8 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
  33   43 2cf8 00000000337c4eb0  1029220 Preemptive  00000000652D0C90:00000000652D2AD8 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
  32   38 1f0c 0000000033cd06a0  1029220 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn (Threadpool Worker) 
XXXX   50    0 00000000335433f0    39820 Preemptive  0000000000000000:0000000000000000 0000000000ea2cd0 0     Ukn 
  35   42 2af4 0000000033545b00    2b220 Preemptive  000000006584D0B0:000000006584EFD0 0000000000ea2cd0 3     Ukn System.ComponentModel.Win32Exception 000000006525bbf0

然后我单独查线程号发现又能查到,很奇怪

0:008> !mex.t 8
DbgID ThreadID       User Kernel Create Time (UTC)
8     286c (0n10348)    0   46ms xx/xxx/xxxx 01:25:43.673 上午

# Child-SP         Return           Call Site
0 000000002caefd28 00007ff9350f818e ntdll!NtDelayExecution+0x14
1 000000002caefd30 0000000180167de2 KERNELBASE!SleepEx+0x9e
2 000000002caefdd0 000000002af4c8b8 QQPinyin+0x167de2
3 000000002caefdd8 0000000000000000 0x2af4c8b8

看下加载的模块 确实加载了QQPinyin的模块

00000001`80000000 00000001`804c6000   QQPinyin T (no symbols)    
0:008> lm
start             end                 module name
...          
00000000`34560000 00000000`346e0000   System_Windows_Forms_resources   (deferred)             
00000001`80000000 00000001`804c6000   QQPinyin T (no symbols)           
...
           
00007ff9`377d0000 00007ff9`379c4000   ntdll      (pdb symbols)          c:\symbols\ntdll.pdb\63E12347526A46144B98F8CF61CDED791\ntdll.pdb

最后在看下QQPinyin 模块的信息

0:008> lmDvmQQPinyin
Browse full module list
start             end                 module name
00000001`80000000 00000001`804c6000   QQPinyin T (no symbols)           
    Loaded symbol image file: QQPinyin.ime
    Image path: C:\Windows\System32\QQPinyin.ime
    Image name: QQPinyin.ime
    Browse all global symbols  functions  data  Symbol Reload
    Timestamp:        Tue Apr 26 13:02:39 2011 (4DB651EF)
    CheckSum:         004BC3A2
    ImageSize:        004C6000
    Index Key:        (GUID) D2567EEAB9BB488F8572C2BBF0F3DCB0
    File version:     4.2.1073.400
    Product version:  4.2.1073.400
    File flags:       0 (Mask 3F)
    File OS:          4 Unknown Win32
    File type:        3.B Driver
    File date:        00000000.00000000
    Translations:     0000.04b0 0000.04e4 0409.04b0 0409.04e4
    Information from resource tables:

QQPinyin输入法对进程注入,进程注入会导致应用不稳定

相关文章:

  • 【综合项目】api系统——基于Node.js、express、mysql等技术
  • 穷举vs暴搜vs深搜vs回溯vs剪枝(典型算法思想)—— OJ例题算法解析思路
  • 【java进阶】java多态深入探讨
  • C# | GDI+图像测距辅助线的实现思路
  • 企业知识库搭建:14款开源与免费系统选择
  • OpenAI开放Deep Research权限,AI智能体大战升级,DeepSeek与Claude迎来新对决
  • 【质量管理】怎么评估职能部门当前质量管理成熟度
  • Innodb MVCC实现原理
  • 【Java学习】Object类与接口
  • qt-C++笔记之QtCreator新建项目即Create Project所提供模板的逐个尝试
  • deepseek 本地化部署(小白也可部署)
  • SQL------搭建sql靶场和打开sql靶场及报错解决
  • 清华deepseek文档下载地址,DeepSeek:如何赋能职场应(附下载包)64页全面详细介绍(二)
  • PCL源码分析:曲面法向量采样
  • 【Python网络爬虫笔记】14-使用代理绕过访问限制
  • [java基础-JVM篇]2_垃圾收集器与内存分配策略
  • Jmeter聚合报告导出log文档,Jmeter聚合报告导出到CSV
  • 量子计算可能改变世界的四种方式
  • 基于Spring Security 6的OAuth2 系列之二十四 -响应式编程之一
  • 图像处理之图像边缘检测算法
  • “非思”的思想——探索失语者的思想史
  • 此前显示售罄的火车票“五一”前大量放出来了?12306回应
  • 荣盛发展股东所持1.17亿股将被司法拍卖,起拍价约1.788亿元
  • 徐徕任上海浦东新区副区长,此前已任区委常委
  • 国务院任免国家工作人员:饶权任国家文物局局长
  • 吕国范任河南省人民政府副省长