• 蓝瓶的钙,好喝的钙——windows,我要蓝屏的


    原文地址:http://80x86.io/post/windows-blue-screen-0x00000050-page_fault_in_nonpaged_area

    这里只截取一部分。

    windows死掉时,为什么“没有”产生dump文件?这个问题依旧不明。 于是再次用神一样的Google找到了答案。

    windows可以产生三种不同的dump文件: 完全内存dump 内核内存dump 迷你内存dump(64KB)

    Windows can generate any one of the following memory dump file types:

    Complete memory dump
    Kernel memory dump
    Small memory dump (64 KB)

    而通常系统产生的是Small memory dump (64 KB),其位置默认在 C:WindowsMinidump

    而此次蓝屏我却没有在这里找到任何dump文件。为什么? 这跟和dump文件产生相关的启动配置有关。 windows的dump文件产生存在一定的规则,这些规则包括: 对于Complete memory dump: If a second problem occurs and another complete memory dump (or kernel memory dump) file is created, the previous file is overwritten.

    对于Kernel memory dump: If a second problem occurs and another kernel memory dump file (or a complete memory dump file) is created, the previous file is overwritten when the 'Overwrite any existing file' setting is checked.

    对于Small memory dump: If a second problem occurs and a second small memory dump file is created, the previous file is preserved. Each additional file is given a distinct name. The date is encoded in the file name. For example, Mini022900-01.dmp is the first memory dump generated on February 29, 2000. A list of all small memory dump files is kept in the %SystemRoot%Minidump folder.

    详情见: http://support.microsoft.com/kb/254649

    由此可见: Complete memory dump在蓝屏再次发生时会被无条件覆盖掉,而Kernel memory dump是否被覆盖要看配置( HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlCrashControl分支下的Overwrite值是否为1,为1值覆盖。 ),Small memory dump则总是被保留。

    于是我看了下我的win 7 的配置:

    System-failure-config

    我这里勾选了“自动重启”,也就是说,蓝屏之后,马上会重启,根本没时间去看蓝屏代码了。那么我是怎么看到蓝屏代码的?开机时按F8,然后选择 Disable automatic restart on system failure 选项启动,就可以无视那个自动重启配置了。

    然后,我看到,我这里配置的dump类型居然是Kernel memory dump ,记得默认应该是Small memory dump (64 KB)的。 既然是Kernel memory dump ,为什么在%SystemRoot% (C:Windows)下面没有看到 MEMORY.DMP 文件? 原因是 memory.dmp 文件的存储/删除算法。其算法如下:

    a. 首先把内核错误报告给Online Crash Analysis Service. b. 然后,如果机器注册表中 AlwaysKeepMemoryDump 项的值被设置为 1, 那么将dump文件存储在磁盘。 c. 否则, 如果机器上的操作系统是Windows Server SKU, 那么将dump文件存储在磁盘。 d. 再则, 如此这台机器加入了windows域 (如一些大公司的工作站会有域服务器,工作站可以加入某个域), 那么将dump文件存储在磁盘。 e. 否则, 如果机器不属于某个域(而是属于某个workgroup,通常家用电脑是这样),那么就进行如下判断: 如果磁盘空闲容量 >= 25GB, 那么将dump文件存储在磁盘。 否则 (磁盘空闲容量 < 25 GB), 删除dump文件.

    windows-dump-file-store-delete-algorithm

    很明显,我这里的情况是AlwaysKeepMemoryDump值为0. 即使到害最后一种,也无法保留dump文件。。。看了下,我的C盘的剩余容量只有12.7GB了。 好了,现在解释了为什么dump文件没有在我的电脑上保存下来。

    AlwaysKeepMemoryDump 的确切位置是:

    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlCrashControl ! AlwaysKeepMemoryDump Type: REG_DWORD.
    

    修改成Small memory dump ,然后把那个自动重启也给去掉。以备防止以后crash系统能保存dump文件。

    ====================================================

    Small memory dump (64 KB) 文件的保存策略: kernel minidumps 文件默认保存在 %SystemRoot%Minidump 目录下。 而这个位置值也是在注册表 HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlCrashControl 分支下的。键名为 MinidumpDir . kernel minidumps 文件的保存策略相对来说比较简单。它是根据以下注册表项来决定是否保存dump文件到磁盘的:

    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlCrashControl ! MinidumpsCount Type: REG_DWORD, default value is 50 
    

    minidump分析工具

    bluescreenview

    由nirsoft出品的一个小工具。很实用。 BlueScreenView scans all your minidump files created during 'blue screen of death' crashes, and displays the information about all crashes in one table. For each crash, BlueScreenView displays the minidump filename, the date/time of the crash, the basic crash information displayed in the blue screen (Bug Check Code and 4 parameters), and the details of the driver or module that possibly caused the crash (filename, product name, file description, and file version). For each crash displayed in the upper pane, you can view the details of the device drivers loaded during the crash in the lower pane. BlueScreenView also mark the drivers that their addresses found in the crash stack, so you can easily locate the suspected drivers that possibly caused the crash.

    bluescreenview bluescreenview2

    =====================================================

    Minilyzer

    这是一个利用windows调试工具分析dump文件的Windows shell脚本文件。 它还支持分析 Full memory dumps (C:WindowsMemory.dmp) 。

    Minilyzer is a Windows shell script that uses Microsoft’s Debugging Tools for Windows to analyze the Minidump files that are created when a BSOD occurs and generate a report detailing the event. Full memory dumps (C:WindowsMemory.dmp) can also be analyzed.

    下载: http://patrickmylund.com/projects/minilyzer/ github地址: https://github.com/pmylund/minilyzer

    minilyzer_screenshot


    参考文档

    http://support.microsoft.com/kb/254649

    Kernel-Mode Dump Files

    Kernel dump storage and clean up behavior in Windows 7

    SKU: SKU是一个通用零售的专业词汇,是英文Stock-Keeping Unit 的缩写,字面意思是库存量单位, 简称SKU,定义为保存库存控制的最小可用单位,这是企业为了方便商品仓库管理而分配的商品编号,一种归类的方法. 详见: http://en.wikipedia.org/wiki/Stock_keeping_unit

  • 相关阅读:
    Java单链表的实现方法汇总整理
    Java内存模型(JMM)图文并茂,条理清晰
    Java基础知识点整理(2021年最新版)
    Spring常见的77道面试题及答案(2021版)
    Python第二次学习知识点总结
    VUE学习十九,表单输入绑定v-model
    VUE学习十八,事件处理v-on
    VUE学习十七,列表渲染v-for
    VUE学习十五,Class与Style绑定
    VUE学习十四,侦听器
  • 原文地址:https://www.cnblogs.com/tcicy/p/8076293.html
Copyright © 2020-2023  润新知