What does Windows error code 813 (ERROR_CPU_SET_INVALID) mean?

 
Previous Next
ERROR_CALLBACK_INVOKE_INLINE ERROR_ENCLAVE_NOT_TERMINATED

ERROR_CPU_SET_INVALID

The specified CPU Set IDs are invalid.

ERROR_CPU_SET_INVALID is Win32 error 813 (0x32D) and belongs to CPU Set selection. The system description identifies the immediate condition but does not identify the caller, object, policy, device, service instance, or transition that produced it.

Interpret this result at the API boundary that returned it. Capture it before logging, cleanup, or another Windows call can replace the thread-local last-error value. Compare the recorded inputs with the documented precondition for CPU Set selection rather than starting with a broad system repair.

Where the result appears

  • This result can surface during SetProcessDefaultCpuSets or SetThreadSelectedCpuSets.
  • This result can surface during a scheduler policy restored after topology changed.
  • It can surface during software using CPU Set IDs obtained on another machine or boot.
  • It can surface during a process mixing CPU Sets with processor-group assumptions.

Likely causes

  • one or more supplied CPU Set IDs are absent from the current topology.
  • the selected logical processor became unavailable or parked by policy.
  • iDs were truncated, confused with processor numbers, or reused after restart.
  • the request contains a combination not valid for the target process or thread.

State boundary to prove

The decisive boundary for this Win32 error is whether one or more supplied CPU Set IDs are absent from the current topology. Prove or disprove that proposition using complete list returned by GetSystemCpuSetInformation together with requested IDs, allocation tags, processor groups, and efficiency classes. When observations for this Win32 error disagree, preserve both and inspect the transition between them instead of choosing the more convenient value.

A focused validation for this Win32 error should recreate the relevant part of this situation: a service stores CPU Set IDs in configuration and reuses them after a VM changes vCPU topology. Re-enumerating the current sets and matching policy attributes fixes the request. The negative case should keep the responsible condition unchanged and confirm error 813; the recovery case should change only that condition and verify a successful result without an unrecorded side effect.

Handling, retry, and recovery

Enumerate CPU Sets again and rebuild the selection from current IDs. Never treat a CPU Set ID as a durable logical-processor number or reuse a cached list after topology changes.

Retry it only after evidence shows a change in CPU Set selection. Initialization, asynchronous completion, recall, or service readiness can justify bounded backoff; malformed metadata, invalid identifiers, policy rejection, unsupported versions, and integrity failures require correction. Before repeating a write or configuration operation after it, query completion state explicitly.

What to log for support and telemetry

  • log decimal 813, hexadecimal 0x32D, and the producing API.
  • log the target object and observed CPU Set selection state.
  • log caller identity, process and thread IDs, machine or node identity, and UTC time.
  • log attempt number, elapsed time, previous result, and any partial side effect.
  • retain the first lower-level or component-specific error before Win32 translation.

Difference from nearby codes

The code identifies invalid CPU Set identifiers, not ordinary affinity-mask exhaustion or a performance complaint.

Practical example

A service stores CPU Set IDs in configuration and reuses them after a VM changes vCPU topology.

Developer and administrator guidance

Code that handles it should keep its Win32 domain visible across exceptions, RPC responses, and JSON or REST wrappers. Administrators should verify the subsystem evidence before changing policy, deleting state, forcing failover, or replacing storage. Recovery is demonstrated only when a test observes 813, changes the responsible condition, and confirms that the same operation succeeds without hidden data loss.

References


Looking for a different code? Search another status or error code.