电脑休眠、待机一段时间后自动重启,系统日志提示系统已在未先正常关机的情况下重新启动。如果系统停止响应、发生崩溃或意外断电,则可能会导致此错误。

一、起因

        电脑开机时间很长,尝试了许多优化开机速度的方法都无效。于是我联系了售后,他们建议我使用系统优化加速工具 V1.37.7549500.exe 进行优化。虽然有些效果,但开机速度仍然很慢。我的笔记本型号是联想小新 Pro 16。

        之后,在休眠或待机一段时间后,出现了自动重启的情况。这种状况我忍耐了一段时间,但最终无法再继续忍受。

二、问题排查

  1. 查看系统日志:记下大致自动重启的时间,之后查看该段时间区间的日志。右击左下角徽标--时间查看器查看日志--系统--windows日志--系统,你或许会查看到如下图显示的日志,系统已在未先正常关机的情况下重新启动。如果系统停止响应、发生崩溃或意外断电,则可能会导致此错误。
  2. 发现规律:发现这行日志的前一行日志必有文件系统筛选器“npsvctrig”(10.0,‎2025‎-‎01‎-‎06T10:41:12.000000000Z)已成功加载并注册到筛选器管理器。
  3. 之后谷歌npsvctrig,找到这篇文章:https://answers.microsoft.com/zh-hans/windows/forum/all/%E7%94%B5%E8%84%91%E5%9C%A8npsvctrig%E5%B7%B2/ff70ebff-e508-4a8a-a5d2-ea437b5ea011右击我的电脑-----属性-----(左侧)高级系统设置----
    高级------“启动和故障恢复”下面的“设置”----
    “写入调试信息”下面选择“小内存转储(256KB)”----
    “小转储目录”输入:
    %SystemRoot%\Minidump,找到dmp文件存放路径
  4. 双击打开查看,权限不足
  5. 赋予权限:右键该文件--属性--安全--编辑--添加--高级--立即查找,找到自己目前登录的用户名,点击确定,之后赋予完全控制权限。
  6. 之后就会看到组或用户名中包含当前登录用户的用户名,之后就可以双击打开了。
  7. 打开后显示信息如下:
    ************* Preparing the environment for Debugger Extensions Gallery repositories **************
       ExtensionRepository : Implicit
       UseExperimentalFeatureForNugetShare : false
       AllowNugetExeUpdate : false
       AllowNugetMSCredentialProviderInstall : false
       AllowParallelInitializationOfLocalRepositories : true
    
       -- Configuring repositories
          ----> Repository : LocalInstalled, Enabled: true
          ----> Repository : UserExtensions, Enabled: true
    
    >>>>>>>>>>>>> Preparing the environment for Debugger Extensions Gallery repositories completed, duration 0.000 seconds
    
    ************* Waiting for Debugger Extensions Gallery to Initialize **************
    
    >>>>>>>>>>>>> Waiting for Debugger Extensions Gallery to Initialize completed, duration 0.016 seconds
       ----> Repository : UserExtensions, Enabled: true, Packages count: 0
       ----> Repository : LocalInstalled, Enabled: true, Packages count: 36
    
    Microsoft (R) Windows Debugger Version 10.0.25877.1004 AMD64
    Copyright (c) Microsoft Corporation. All rights reserved.
    
    
    Loading Dump File [C:\Windows\Minidump\021724-196312-01.dmp]
    Mini Kernel Dump File: Only registers and stack trace are available
    
    Symbol search path is: srv*
    Executable search path is: 
    Windows 10 Kernel Version 19041 MP (16 procs) Free x64
    Product: WinNt, suite: TerminalServer SingleUserTS
    Kernel base = 0xfffff801`1b600000 PsLoadedModuleList = 0xfffff801`1c22a770
    Debug session time: Sat Feb 17 21:23:14.855 2024 (UTC + 8:00)
    System Uptime: 0 days 1:35:38.558
    Loading Kernel Symbols
    ...............................................................
    ................................................................
    ................................................................
    ..............................................
    Loading User Symbols
    
    Loading unloaded module list
    ....................
    For analysis of this file, run !analyze -v
    nt!KeBugCheckEx:
    fffff801`1b9fd5b0 48894c2408      mov     qword ptr [rsp+8],rcx ss:0018:ffff8b0f`8ac279e0=0000000000000116
    
    
  8.  看不懂,扔到chatgpt
  9.  点击界面中的!analyze -v,将出现如下信息
    5: kd> !analyze -v
    *******************************************************************************
    *                                                                             *
    *                        Bugcheck Analysis                                    *
    *                                                                             *
    *******************************************************************************
    
    VIDEO_TDR_FAILURE (116)
    Attempt to reset the display driver and recover from timeout failed.
    Arguments:
    Arg1: ffffa68890e9a460, Optional pointer to internal TDR recovery context (TDR_RECOVERY_CONTEXT).
    Arg2: fffff801375a09a0, The pointer into responsible device driver module (e.g. owner tag).
    Arg3: ffffffffc000009a, Optional error code (NTSTATUS) of the last failed operation.
    Arg4: 0000000000000004, Optional internal context dependent data.
    
    Debugging Details:
    ------------------
    
    Unable to load image nvlddmkm.sys, Win32 error 0n2
    *** WARNING: Unable to verify timestamp for nvlddmkm.sys
    
    KEY_VALUES_STRING: 1
    
        Key  : Analysis.CPU.mSec
        Value: 3280
    
        Key  : Analysis.Elapsed.mSec
        Value: 6727
    
        Key  : Analysis.IO.Other.Mb
        Value: 0
    
        Key  : Analysis.IO.Read.Mb
        Value: 0
    
        Key  : Analysis.IO.Write.Mb
        Value: 0
    
        Key  : Analysis.Init.CPU.mSec
        Value: 421
    
        Key  : Analysis.Init.Elapsed.mSec
        Value: 420194
    
        Key  : Analysis.Memory.CommitPeak.Mb
        Value: 103
    
        Key  : Bugcheck.Code.LegacyAPI
        Value: 0x116
    
        Key  : Dump.Attributes.AsUlong
        Value: 8
    
        Key  : Dump.Attributes.KernelGeneratedTriageDump
        Value: 1
    
        Key  : Failure.Bucket
        Value: 0x116_IMAGE_nvlddmkm.sys
    
        Key  : Failure.Hash
        Value: {c89bfe8c-ed39-f658-ef27-f2898997fdbd}
    
    
    BUGCHECK_CODE:  116
    
    BUGCHECK_P1: ffffa68890e9a460
    
    BUGCHECK_P2: fffff801375a09a0
    
    BUGCHECK_P3: ffffffffc000009a
    
    BUGCHECK_P4: 4
    
    FILE_IN_CAB:  021724-196312-01.dmp
    
    DUMP_FILE_ATTRIBUTES: 0x8
      Kernel Generated Triage Dump
    
    VIDEO_TDR_CONTEXT: dt dxgkrnl!_TDR_RECOVERY_CONTEXT ffffa68890e9a460
    Symbol dxgkrnl!_TDR_RECOVERY_CONTEXT not found.
    
    PROCESS_OBJECT: 0000000000000004
    
    BLACKBOXBSD: 1 (!blackboxbsd)
    
    
    BLACKBOXNTFS: 1 (!blackboxntfs)
    
    
    BLACKBOXPNP: 1 (!blackboxpnp)
    
    
    BLACKBOXWINLOGON: 1
    
    CUSTOMER_CRASH_COUNT:  1
    
    PROCESS_NAME:  System
    
    STACK_TEXT:  
    ffff8b0f`8ac279d8 fffff801`28f765ae     : 00000000`00000116 ffffa688`90e9a460 fffff801`375a09a0 ffffffff`c000009a : nt!KeBugCheckEx
    ffff8b0f`8ac279e0 fffff801`28f26b54     : fffff801`375a09a0 ffffa688`70931850 00000000`00002000 ffffa688`70931910 : dxgkrnl!TdrBugcheckOnTimeout+0xfe
    ffff8b0f`8ac27a20 fffff801`28f1f68c     : ffffa688`740da000 00000000`01000000 00000000`00000004 00000000`00000004 : dxgkrnl!ADAPTER_RENDER::Reset+0x174
    ffff8b0f`8ac27a50 fffff801`28f75cd5     : 00000000`00000100 ffffa688`740daa70 00000000`654a3a20 ffffe1d4`c228326a : dxgkrnl!DXGADAPTER::Reset+0x4dc
    ffff8b0f`8ac27ad0 fffff801`28f75e47     : fffff801`1c325440 00000000`00000000 00000000`00000000 00000000`00000300 : dxgkrnl!TdrResetFromTimeout+0x15
    ffff8b0f`8ac27b00 fffff801`1b8c46b5     : ffffa688`7e27e040 fffff801`28f75e20 ffffa688`654a3a20 ffffa688`00000000 : dxgkrnl!TdrResetFromTimeoutWorkItem+0x27
    ffff8b0f`8ac27b30 fffff801`1b9078e5     : ffffa688`7e27e040 00000000`00000080 ffffa688`654d2080 000fe067`bcbbbdff : nt!ExpWorkerThread+0x105
    ffff8b0f`8ac27bd0 fffff801`1ba06378     : ffffd100`f1586180 ffffa688`7e27e040 fffff801`1b907890 00000000`00000000 : nt!PspSystemThreadStartup+0x55
    ffff8b0f`8ac27c20 00000000`00000000     : ffff8b0f`8ac28000 ffff8b0f`8ac21000 00000000`00000000 00000000`00000000 : nt!KiStartSystemThread+0x28
    
    
    SYMBOL_NAME:  nvlddmkm+eb09a0
    
    MODULE_NAME: nvlddmkm
    
    IMAGE_NAME:  nvlddmkm.sys
    
    STACK_COMMAND:  .cxr; .ecxr ; kb
    
    FAILURE_BUCKET_ID:  0x116_IMAGE_nvlddmkm.sys
    
    OSPLATFORM_TYPE:  x64
    
    OSNAME:  Windows 10
    
    FAILURE_ID_HASH:  {c89bfe8c-ed39-f658-ef27-f2898997fdbd}
    
    Followup:     MachineOwner
    ---------

10. 再次扔到chatgpt

三、解决方法 

在管理员权限cmd窗口执行Windows系统中用于修复损坏系统文件的命令,步骤如下:

  1. 在Windows任务栏的搜索框中,键入“cmd”或“命令提示符”。
  2. 右键单击显示的“命令提示符”应用程序。
  3. 在弹出的菜单中,选择“以管理员身份运行”。
  4. 首先输入sfc /scannow回车。
  5. 之后输入dism /online /cleanup-image /restorehealth回车,注意!这条命令需要联网。
  • 37
    点赞
  • 41
    收藏
    觉得还不错? 一键收藏
  • 16
    评论
以下是一段内核代码,定期执行打印时间的任务,但是在系统休眠或panic时停止打印: ``` #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/time.h> #include <linux/timer.h> #include <linux/suspend.h> static struct timer_list my_timer; static void print_time(unsigned long data) { printk(KERN_INFO "Current time: %ld\n", (long)jiffies); mod_timer(&my_timer, jiffies + msecs_to_jiffies(1000)); // 1 second interval } static int __init my_init(void) { printk(KERN_INFO "Starting time printing task...\n"); setup_timer(&my_timer, print_time, 0); mod_timer(&my_timer, jiffies + msecs_to_jiffies(1000)); // start after 1 second return 0; } static void __exit my_exit(void) { del_timer_sync(&my_timer); printk(KERN_INFO "Stopping time printing task...\n"); } static int my_suspend(void) { del_timer_sync(&my_timer); return 0; } static int my_resume(void) { mod_timer(&my_timer, jiffies + msecs_to_jiffies(1000)); // resume after 1 second return 0; } static struct syscore_ops my_syscore_ops = { .suspend = my_suspend, .resume = my_resume, }; module_init(my_init); module_exit(my_exit); MODULE_LICENSE("GPL"); static int __init my_init(void) { printk(KERN_INFO "Starting time printing task...\n"); setup_timer(&my_timer, print_time, 0); mod_timer(&my_timer, jiffies + msecs_to_jiffies(1000)); // start after 1 second register_syscore_ops(&my_syscore_ops); return 0; } static void __exit my_exit(void) { unregister_syscore_ops(&my_syscore_ops); del_timer_sync(&my_timer); printk(KERN_INFO "Stopping time printing task...\n"); } static int my_suspend(void) { del_timer_sync(&my_timer); return 0; } static int my_resume(void) { mod_timer(&my_timer, jiffies + msecs_to_jiffies(1000)); // resume after 1 second return 0; } static struct syscore_ops my_syscore_ops = { .suspend = my_suspend, .resume = my_resume, }; module_init(my_init); module_exit(my_exit); MODULE_LICENSE("GPL"); ``` 这段代码在内核初始化时注册一个定时器,每隔1秒打印一次当前时间。如果系统进入睡眠状态,定时器被删除,直到系统恢复为止。如果系统panic,则定时器也停止。为了处理系统休眠和恢复,这段代码还注册了一个syscore操作,用于在系统进入和退出休眠状态时启动和停止定时器。
评论 16
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值