Skip to content

Zed fails to start on Windows: missing windowsperformancerecordercontrol.dll #62334

Description

@mboveiri

Bug Description

Zed.exe fails to launch on Windows with a system error dialog: "The code execution cannot proceed because windowsperformancerecordercontrol.DLL was not found."

Image

This is a load-time dependency (direct import in Zed.exe's import table) that is part of the Windows OS but was missing from C:\Windows\System32 on my system. The DLL appears to have been removed by antivirus/EDR software (F-Secure in my case) after being copied there.

Steps to Reproduce

  1. Install Zed on Windows (via official installer at %LOCALAPPDATA%\Programs\Zed\Zed.exe)
  2. Ensure windowsperformancerecordercontrol.dll is NOT present in C:\Windows\System32 (may be missing on some Windows installs or removed by AV)
  3. Launch Zed.exe
  4. Observe system error dialog about missing DLL

Expected Behavior

Zed should either:

  • Bundle the required DLL locally (next to Zed.exe) so it loads from the application directory first, OR
  • Gracefully handle the missing dependency with a clear error message, OR
  • Not depend on this obscure Windows component at all if it's not essential

Actual Behavior

Hard crash at process startup with a Windows system error dialog. No Zed UI appears, no logging, no graceful fallback.

Environment

  • OS: Windows 10/11 (tested on Windows 10)
  • Zed version: Latest stable (installer dated 2025-08-05)
  • Antivirus: F-Secure (which quarantined the DLL after manual copy to System32)

Technical Details

Import Analysis

Zed.exe has a direct (load-time) import for windowsperformancerecordercontrol (no .dll suffix in import table -- Windows appends it):

windowsperformancerecordercontrol
kernel32.dll
advapi32.dll
... (etc)

This means the Windows loader tries to resolve this DLL before any Zed code runs.

Root Cause

The DLL (Microsoft Windows Performance Recorder Control Library, version 10.0.26100.x) is an optional Windows component that may not be installed by default on all Windows 10/11 configurations, or may be removed by security software due to its low prevalence and association with ETW tracing (sometimes flagged as suspicious).

Workaround (Manual Fix)

  1. Download a genuine, Microsoft-signed copy of windowsperformancerecordercontrol.dll (64-bit)
  2. Verify its digital signature: CN=Microsoft Corporation, O=Microsoft Corporation issued by Microsoft Windows Code Signing PCA 2024
  3. Place it in both locations:
    • C:\Windows\System32\ (system-wide)
    • %LOCALAPPDATA%\Programs\Zed\ (application directory -- loader checks here first)
  4. Launch Zed -- it starts successfully

Suggested Fixes (in order of preference)

  1. Bundle the DLL with Zed installer -- place windowsperformancerecordercontrol.dll next to Zed.exe in the installation directory. Windows loader searches the application directory before System32, so this avoids any system dependency and AV interference.
  2. Make the dependency optional / delay-load -- if this DLL is only used for optional profiling/telemetry, change the import to delay-load (/DELAYLOAD) and handle missing DLL gracefully at runtime.
  3. Remove the dependency entirely -- if Zed doesn't actually need Windows Performance Recorder functionality, remove the import from the build.

Additional Context

  • The DLL is part of the Windows Performance Toolkit (WPR/WPA) and is used for ETW trace control.
  • It has very low popularity on Windows systems (per nirsoft/dllme data: "Very Low - There is no any other DLL in system32 directory that is statically linked to this file").
  • Security tools (F-Secure, Defender, etc.) may flag/quarantine unknown DLLs dropped into System32, making manual fixes unreliable.
  • Bundling the DLL with the app is the standard Windows deployment practice for such dependencies (see: VC++ runtime, WebView2, etc.).

Verification

After placing the signed DLL in both locations, Zed launches successfully and displays the "empty project" window. No further errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:needs triagetriage is not complete: no `area:*` label, or no `severity:*`/`reach:*` for Bugs/Crashes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions