- 浏览: 475711 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
alvin198761:
renzhengzhi 写道我参与过12306余票查询系统的开 ...
别给12306 辩解了 -
renzhengzhi:
我参与过12306余票查询系统的开发,用户请求被前面3层缓存拦 ...
别给12306 辩解了 -
renzhengzhi:
写的很好。
JAVA线程dump的分析 -
liyonghui160com:
说好的附件呢
分布式服务框架 Zookeeper -- 管理分布式环境中的数据 -
ghpaas:
orbeon作为xforms标准的实现,不论其设计器还是运行时 ...
XForms 1.1 中文翻译—第1章 关于XForms标准
How to debug application crash/hang in production environment?
- 博客分类:
- Web性能
A common tough scenario is the application crash/hang in production environment. Production environment is different from development environment that it normally does not have any powerful tools to obtain information regarding application failure. In this blog entry, I will talk about 2 wonderful tools to help collect information in production environment: Windbg and Process Explorer. Application Crash: Crash is the most common scenario of application failure. It is actually caused by an unhanded exception generated in the application. There are 2 types of information that are common critical to resolve application crash: 1. Unhandled exception type (it is called exception code in unmanaged world) and error message 2. The full stack trace for the unhandled exception These 2 types of information are trivial to obtain in development environment, because the application runs under the VS debugger, the debugger will tell us this information while unhandled exception is caught. In production environment, it may not be practical to install Visual Studio IDE for debugging, because: 1. Visual Studio is not free. 2. VS has a large memory footprint. 3. The problem can even disappear after installing the Visual Studio. Windbg and Process Explorer are 2 free download tools with much less impact on end user. Using Windbg to obtain Application Crash information: Windbg is included in the Microsoft “Debugging tools for Windows”. You may download the “Debugging tools for Windows” from the link below: http://www.microsoft.com/whdc/devtools/debugging/default.mspx After installing windbg, the first thing is setting up the symbol path for it. The symbol path is critical during debugging, because windbg will retrieve the Windows system dlls internal symbols from the symbol path to display the meaningful name for functions/variables. Without the correct symbol loaded, the debugger can only display the numeric memory address for the functions/variables. For example, in a windbg without symbol path, if we use “k” command to obtain the current call stack, we will see following output(note the red numeric): 0:000> k *** ERROR: Module load completed but symbols could not be loaded for notepad.exe ChildEBP RetAddr WARNING: Stack unwind information not available. Following frames may be wrong. 0007f6ec 01001fe4 USER32!MessageBoxW 0007f70c 010027e7 notepad+0x1fe4 0007f944 010035b9 notepad+0x27e7 0007f960 7739c3b7 notepad+0x35b9 0007f98c 7739c484 USER32!EnableMenuItem+0x4cd4 0007fa04 7739ca68 USER32!EnableMenuItem+0x4da1 0007fa60 7739ce7a USER32!TranslateMessageEx+0xd5 0007fa88 7c82ec9e USER32!MsgWaitForMultipleObjectsEx+0x126 0007fb08 773966f0 ntdll!KiUserCallbackDispatcher+0x2e 0007fb24 7739668a USER32!DefWindowProcW+0xc7 0007fb6c 010038e2 USER32!DefWindowProcW+0x61 0007fb94 7739c3b7 notepad+0x38e2 0007fbc0 7739c484 USER32!EnableMenuItem+0x4cd4 0007fc38 7739ca68 USER32!EnableMenuItem+0x4da1 0007fc94 7739ce7a USER32!TranslateMessageEx+0xd5 0007fcbc 7c82ec9e USER32!MsgWaitForMultipleObjectsEx+0x126 0007fd3c 773966f0 ntdll!KiUserCallbackDispatcher+0x2e 0007fd58 7739668a USER32!DefWindowProcW+0xc7 0007fda0 010037fc USER32!DefWindowProcW+0x61 0007fdc8 7739c3b7 notepad+0x37fc Yes, the windbg can only recognize the export function names of the dll. Since we do not have the symbol for notepad.exe, the windbg will only display a *magic* number for the function memory address which is not meaningful to us. To set the symbol path, you may set the following path in the windbg menu item File->”Symbol File Path…”: “srv*DownstreamStore*http://msdl.microsoft.com/download/symbols”
Change “DownstreamStore” to any local folder to cache the downloaded symbol files on your machine. For example, I normally use “srv*c:\LocalSymbols* http://msdl.microsoft.com/download/symbols”. Now, you may open the windbg and click File->”Open Executable…” and select your application for launching. Windbg will launch your application and break in the initial loader breakpoint. You can check the red rectangle in the figure to ensure the symbol path is correct:
You may press “F5” or input “g” command to tell windbg to ignore the initial loader breakpoint. Now, you may manipulate your application to reproduce the crash. When the application crashes with exception, windbg will automatically break-in your application. Then you may input “k” command to get the full stack trace of this exception/failure. Note: the “k” command may require some time to load the symbols from Microsoft symbol server for the system dlls the first time. So the windbg will report “busy…” for sometime. You may wait to have a coffee for the symbol loading and output. Use Process Explorer to obtain application hangs information: Process Explorer can be free downloaded in the http://www.microsoft.com/technet/sysinternals/utilities/ProcessExplorer.mspx Process Explorer is especially suitable for troubleshooting hang problem in application, because it has a very good UI for monitor threads activity. After downloading the Process Explorer, the first thing to do is still setting the symbol server path as we do in windbg:
Note: in the “Dbghelp.dll path” textbox above, I used to Dbghelp.dll in “Debugging Tools for Windows” package, because this Dbghelp.dll has a higher version than the one in “%windir%/System32/”. If you do not have “Debugging Tools for Windows” installed on end user machine, you can live with using the one in “%windir%/System32/” directory. Let’s demonstrate the Process Explorer usage with a sample. In a .Net Winform application, we write the following code in an existing VC application to simulate the hang in application: Sleep(30000); While the application is hang, we can find the application in the Process Explorer and double click it to launch its property dialog. Then, we should switch to the “Threads” tabpage to examine the thread status. This is what I got in the sample: As you can see there is only one thread in the test application. Then, we can select the thread and click “Stack” button in the dialog, we got: Aha, by examining this stack trace, we can see that “VMQueryHelper” function calls Sleep() function, which causes the hang. Use Windbg to obtain application hangs information: Windbg can also be used to troubleshoot the application hang. I assume you have downloaded the windbg and set up the symbol path the same way as said in first section. Now, another .Net application is hanging in customer’s machine. We can use windbg to attach the hang application with the menu item below: In the dialog, we can choose the hang application and click Ok button: In the windbg, the first thing we should do is checking how many threads are there in the hang application with “~*” command, please see the figure below. As you can see in the figure, thread #0 is executing _CorExeMain method, which is .Net Winform application main GUI thread. The thread #5 has a “.” in the front which means the current examine thread. Because the application hang occurs in the main GUI thread, we should switch the current thread to the #0 thread by inputting “~0s”, see figure. Now, the context is switched to the main GUI hang thread. We can input the “K” command to get the full stack trace of the hang thread to see what it is waiting for. All these 3 commands and output are listed in the figure below.
As you can see it is the Button.Click() method in .Net Winform calls the System.Threading.Thread.Sleep(30000) that caused the hang.
发表评论
-
高性能、高流量Java Web站点打造的最佳实践
2013-12-24 11:23 2801从2005年-2013年,Ashwanth Fernando ... -
高性能、高流量Java Web站点打造的最佳实践
2013-12-24 11:01 4从2005年-2013年,Ashwanth ... -
20行实现javascript模板引擎
2013-12-23 10:35 149920行实现javascript模板引擎 我仍然在用Abs ... -
标题怎么办
2012-03-25 23:50 21.首先在这里 下载Selenium RC,解压到C盘。 ... -
Google Page Speed应用上线,移动设备也在支持之列
2011-04-05 21:23 846Google已经将Page Speed应用到线上,并且加强 ... -
浏览器的加载与页面性能优化
2011-02-16 11:23 1274本文将探讨浏览器渲染的loading过程,主要有2 ... -
门户网站负载均衡技术的六大新挑战
2010-12-23 11:25 967文 / 李晓栋 记得上 ... -
使用 JAWS 测试 Web 应用的技巧
2010-10-31 23:34 1623屏幕阅读器简介 屏幕阅读器(S ... -
How We Evaluate the Experiences We Engineer
2010-10-26 14:38 7089 and how we measured (and co ... -
研究显示:众多网上零售商未遵循Web优化基本准则
2010-10-26 10:25 685Web优化专家Joshua Bixby最近在博客中披露,在 ... -
Testing sites with Browser Mode vs. Doc Mode
2010-10-22 10:07 1052With site developers verifying ... -
Common Security Mistakes in Web Applications
2010-10-22 10:02 1678Web application developers toda ... -
A (somewhat) brief history of the performance landscape
2010-10-21 10:44 1697I’d like to enlist your help. ... -
Best Practices for Speeding Up Your Web Site
2010-10-20 10:40 1195Minimize HTTP Requests tag: ... -
Web Performance Optimization Use Cases – Part 1 Benchmarking
2010-10-19 14:40 922Web Performance Optimizatio ... -
Google WebP——让图片更小,让页面访问速度更快
2010-10-12 13:14 1572Google日前对外宣布了一种新的图片压缩格式WebP,可 ... -
剖析IE浏览器子系统的性能权重
2010-09-02 13:23 857最近,InfoQ中文站报道了Web 2.0应用客户端性能问 ... -
Performance: Profiling how different web sites use browser subsystems
2010-09-02 00:41 1200When we first showed IE9 at t ... -
Measuring Browser Performance: Understanding issues in benchmarking and performa
2010-09-02 00:40 934Measuring Browse ... -
Ajax应用开发:实践者指南
2010-08-10 21:13 940目前的Web应用开发基本上都是围绕富互联网应用(Rich ...
相关推荐
该项目为基于Java语言的蓝牙遥控器设计源码,包含539个文件,涵盖307个Java源文件、120个XML配置文件、34个PNG图片文件、16个Gradle构建文件、12个Git忽略文件、9个文本文件、6个JAR包文件、5个JSON配置文件、5个JPG图片文件。该遥控器支持键盘、鼠标和影音控制功能,适用于多种场合。
数据手册-74HC573-datasheet.zip
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
关于C++的资源描述和项目源码,以下是一些关键信息: 资源描述 C++是一种广泛应用于开发高性能应用程序的编程语言,既有高级语言的特性,也有低级语言的效率。以下是C++学习资源的简要描述: 在线课程:如优达学城提供的C++中级课程,以及北京大学提供的C++程序设计和C++程序设计进阶课程,这些课程适合从零开始系统学习C++,涵盖从基础到高级的编程内容。 书籍:如《C++ Primer》、《Effective C++》和《C++标准库》等,这些书籍详细介绍了C++语言的基本概念和编程技术,适合作为自学或课堂教学的参考资料。 在线社区:如CSDN博客和Stack Overflow等,这些社区提供了丰富的C++编程教程、示例代码和问题解决方案,是学习和交流C++编程技术的重要平台。 开发工具:如Visual C++(VC)等集成开发环境(IDE),提供了编译器、调试器和其他工具,方便开发者进行Windows平台上的C++应用程序开发。 项目源码 由于项目源码通常包含大量的代码文件和资源文件,且涉及版权和知识产权问题,因此无法在此直接提供完整的项目源码。不过,以下是一些获取C++项目源码的
锻压成型机_三维3D设计图纸.zip
mmexport1728042361260.mp4
谷歌浏览器Linux版本google-chrome-stable-current-amd64.deb
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
该项目是一款基于Python编写的运输车辆风险预估算法设计源码,包含20个文件,其中9个为Python源代码文件,5个为XML配置文件,2个为Git忽略文件,2个为Excel工作簿文件,以及其余文件类型各1个。该系统旨在通过GPS定位数据对运输车辆的风险进行有效预估,为运输安全管理提供技术支持。
本项目是一款瑞吉外卖点餐系统,采用HTML/CSS/JavaScript进行开发,并集成了Java后端支持。整个项目源码共包含196个文件,其中Java文件73个,PNG图片文件43个,JavaScript文件22个,HTML文件21个,CSS文件18个,字体文件6个,图标文件2个,JSON文件2个以及其他格式文件。该系统旨在提供流畅的点餐体验,满足用户在线点餐需求。
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
该项目为基于Java语言的BasketBallDemo约战篮球设计源码,包含488个文件,其中包含433个PNG图片文件、23个XML配置文件、13个Java源文件、9个JPG图片文件、5个aar库文件、1个Markdown文档、1个Git忽略文件、1个Gradle构建文件、1个批处理文件和1个属性文件。该系统专注于篮球爱好者的约战管理功能。
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
buck双闭环控制仿真降压电路PI调节器设计降压斩波电路建模和数学模型建模 建模方法有状态空间平均法,开关元件平均模型法,开关网络平均模型法提供双闭环调节器设计方案 从滤波器设计到pi调节器设计再到仿真。 从滤波器设计到建模,得到被控对象的传递函数,再根据传递函数设计pi调节器,最后把计算出来的pi参数带入仿真验证。
该项目是一款基于Java语言开发的掌上英雄联盟能力分析效果模拟应用,源码包含44个文件,涵盖9个XML配置文件、8个Java源文件、6个JSON配置文件、4个Gradle构建文件、3个Git忽略文件、3个属性文件以及其他相关文件,旨在重现英雄联盟能力分析的用户界面和交互体验。
那些年,与你同分同位次的同学都去了哪里?全国各大学在辽宁2020-2024年各专业最低录取分数及录取位次数据,高考志愿必备参考数据
该项目是一款基于Java语言的Android智能家居系统设计源码,共计75个文件,其中包含24个XML配置文件、17个Java源文件、11个PNG图片文件、10个JPG图片文件、3个Git忽略文件、3个Gradle构建文件、2个属性文件以及1个LICENSE文件。该系统设计简单实用,适用于智能家居场景。
系统级电路 10 100Mbps 10BASE-T ETHERENT-PHY以太网 cadence官方教程和文件,足够专业 有电路,有工艺库,有版图 有两个版本,一份是工艺是Gpdk90nm(主要),一份是Gpdk180nm,都是有版图(TOP,cell都有),Cadence自己家的电路 如图,保姆级操作教程,从导入库启动cadence开始的那种 内容: 有两个锁相环,模拟均衡器eq pi相位差值 flash ADC,带triming bg LDO,比较器 电平移位,译码电路 数字电路,偏置电流源 运放,trans DAC,滤波器 有很多仿真tb,非常的详细 两个子模块PLL仿真,ADC仿真,bg ldo 模块仿真,TOP整体ams仿真,有版图,没流片,不是反向电路。 有几份RAK讲解文件,有讲top的,然后有几份pdf是讲里面的子模块的。
棉花自动灌装缝纫机_三维3D设计图纸.zip