藍瓶的鈣,好喝的鈣——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:\Windows\Minidump

而此次藍屏我卻沒有在這里找到任何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_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl分支下的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_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl ! AlwaysKeepMemoryDump Type: REG_DWORD.

修改成Small memory dump ,然后把那個自動重啟也給去掉。以備防止以后crash系統能保存dump文件。

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

Small memory dump (64 KB) 文件的保存策略: kernel minidumps 文件默認保存在 %SystemRoot%\Minidump 目錄下。 而這個位置值也是在注冊表 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl 分支下的。鍵名為 MinidumpDir . kernel minidumps 文件的保存策略相對來說比較簡單。它是根據以下注冊表項來決定是否保存dump文件到磁盤的:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl ! 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:\Windows\Memory.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:\Windows\Memory.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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM