PresentMon icon indicating copy to clipboard operation
PresentMon copied to clipboard

[Bug]: PresentMon.exe crashes with STATUS_ACCESS_VIOLATION (0xC0000005) at Kernel.cpp(247) on pipe timeout; installer lacks service recovery actions

Open ending3729 opened this issue 2 months ago • 1 comments

[!NOTE] Disclaimer: This issue was investigated, diagnosed, log-analyzed, reproduced, and drafted collaboratively using Gemini 3.8 Flash (High) via Antigravity pair programming.

Summary

When PresentMon.exe is launched, if PresentMonSharedService is stopped, delayed during system boot, or fails to open its named pipe within the connection timeout window, PresentMon.exe crashes immediately with an unhandled STATUS_ACCESS_VIOLATION (SEH exception 0xC0000005) in p2c::kern::Kernel::ThreadProcedure_ at Kernel.cpp(247).

Additionally, the Intel PresentMon installer does not configure any Windows Service Failure Recovery actions (sc failure) for PresentMonSharedService. If the service encounters a transient failure or delay during system boot, Windows leaves it permanently stopped, causing all subsequent launches of PresentMon to crash instantly.


System Information

  • PresentMon Version: 2.5.1.0 (PresentMon.exe, PresentMonService.exe, PresentMonUI.exe)
  • OS: Microsoft Windows 11 IoT Enterprise LTSC (Build 26100, 64-bit)
  • Installation Path: C:\Program Files\Intel\PresentMon\ and C:\Program Files\Intel\PresentMonSharedService\

Diagnostic Logs

1. Middleware Log (%LOCALAPPDATA%\Intel\PresentMon\logs\pmlog-mid.txt)

(Timestamps converted to UTC)

[@Error] <10396:4568> {2026-09-30 20:05:05.9753583 UTC}
  [class pmon::ipc::PmStatusError] Timeout waiting for service action pipe to become available CODE:[12]
  !PM_STATUS [0x0000000C] (PM_STATUS_PIPE_ERROR): Pipe Error => An error occurred in connecting to or communicating over named pipes
  >> at pmOpenSessionWithPipe 
     D:\source\repos\PresentMonInternal\drivers.gpu.tools.presentmon\IntelPresentMon\PresentMonAPI2\PresentMonAPI.cpp(175)

2. Kernel Process Crash Log (%LOCALAPPDATA%\Intel\PresentMon\logs\pmlog.txt)

(Timestamps converted to UTC)

[@Error] <kproc(10396):kernel(4568)> {2026-09-30 20:05:05.9759969 UTC}
  Server attempting to send when no client is connected
  >> at pmon::ipc::act::SymmetricActionServer<struct kproc::kact::KernelExecutionContext>::DispatchDetached 
     D:\source\repos\PresentMonInternal\drivers.gpu.tools.presentmon\IntelPresentMon\Interprocess\source\act\SymmetricActionServer.h(79)

[@Error] <kproc(10396):kernel(4568)> {2026-09-30 20:05:05.9769179 UTC}
  [class pmon::util::SehException] Error Code [0xC0000005]: STATUS_ACCESS_VIOLATION
  >> at p2c::kern::Kernel::ThreadProcedure_ 
     D:\source\repos\PresentMonInternal\drivers.gpu.tools.presentmon\IntelPresentMon\Core\source\kernel\Kernel.cpp(247)

[@Error] <kproc(10396):main(4696)> {2026-09-30 20:05:05.9957570 UTC}
  [class pmon::util::SehException] Error Code [0xC0000005]: STATUS_ACCESS_VIOLATION
  >> at WinMain 
     D:\source\repos\PresentMonInternal\drivers.gpu.tools.presentmon\IntelPresentMon\KernelProcess\winmain.cpp(558)

Root Cause Analysis

  1. Unhandled Null Session Handle on Pipe Failure:
    In IntelPresentMon\Core\source\kernel\Kernel.cpp, ThreadProcedure_ calls pmOpenSession / pmOpenSessionWithPipe. When this returns PM_STATUS_PIPE_ERROR (code 0x0000000C), the session pointer remains null or invalid. Subsequent execution attempts to dereference this handle at line 247 without verifying success, triggering an unhandled SEH 0xC0000005 access violation.

  2. Missing Service Failure Actions in Installer:
    Checking service configuration via sc.exe qfailure PresentMonSharedService:

    SERVICE_NAME: PresentMonSharedService
            RESET_PERIOD (in seconds)    : 0
            REBOOT_MESSAGE               : 
            COMMAND_LINE                 : 
            FAILURE_ACTIONS              : (none)
    

    If PresentMonSharedService terminates unexpectedly or fails during early system startup, Windows never attempts to restart it.


Steps to Reproduce

  1. Stop PresentMonSharedService:
    Stop-Service PresentMonSharedService
    
  2. Attempt to launch PresentMon.exe:
    & "C:\Program Files\Intel\PresentMon\PresentMonApplication\PresentMon.exe"
    
  3. Observe that PresentMon.exe terminates immediately without an error message or window.
  4. Inspect %LOCALAPPDATA%\Intel\PresentMon\logs\pmlog.txt to find the STATUS_ACCESS_VIOLATION crash at Kernel.cpp(247).

Suggested Fixes

  1. In Kernel.cpp: Check the PM_STATUS return code from pmOpenSession / pmOpenSessionWithPipe. If it is not PM_STATUS_SUCCESS, abort gracefully and present a clear user-facing error dialog (e.g., "Unable to connect to PresentMon Shared Service. Please ensure the service is running.") instead of continuing with a null handle.

  2. In the Installer (WiX / MSI Service Configuration): Add automatic recovery actions for PresentMonSharedService so Windows restarts the service upon failure:

    sc.exe failure PresentMonSharedService reset= 86400 actions= restart/5000/restart/10000/restart/20000
    

ending3729 avatar Oct 01 '26 10:10 ending3729

Thank you for the submission. We have confirmed the regression and have a fix incoming.

planetchili avatar Oct 02 '26 20:10 planetchili