| Previous | Next |
| ERROR_INSTRUCTION_MISALIGNMENT | ERROR_PROFILING_NOT_STOPPED |
ERROR_PROFILING_NOT_STARTED
What ERROR_PROFILING_NOT_STARTED means
This status is returned when code attempts to stop, query, or otherwise operate on a profiling session that was never started, has already ended, or was created in a different scope. It is primarily a sequencing error rather than evidence that the profiler itself is damaged.
Where it commonly appears
- Performance-analysis tools that start and stop kernel or process profiling sessions
- Diagnostic agents that expose profiling through a service or RPC boundary
- Cleanup paths that run after partial initialization and assume a session exists
Likely causes
- The start operation failed but the failure was ignored
- A stop or query call was issued twice
- The session handle belongs to another process, target, or boot session
- Concurrent cleanup raced with normal shutdown
Diagnostic checklist
- Log the result of the original start call and retain the first failure
- Record the session identifier, target process, caller PID, and start/stop timestamps
- Check whether cleanup can run from more than one thread
- Verify that a restart or service reconnect did not discard the in-memory session state
Guidance for developers
Model profiling as an explicit state machine: not started, active, stopping, and stopped. Transition to active only after the start call succeeds. Make cleanup idempotent, and do not overwrite the original initialization failure with this secondary status.
Guidance for administrators
If this appears in a third-party profiler, restart the profiling session rather than repeatedly issuing stop or query commands. Collect the profiler log and the first error before restarting the service.
Example incident
A monitoring service allocates its bookkeeping object, fails to enable profiling because access is denied, and later executes a generic shutdown routine. The shutdown routine calls the stop API and receives this code. The actionable failure is the earlier access-denied result, not the shutdown status.
Related conditions
Do not confuse this with ERROR_PROFILING_NOT_STOPPED, which means an active profiling operation could not be stopped, or ERROR_PROFILING_AT_LIMIT, which means a resource limit prevented another profile from starting.
Operational decision points
Before retrying, the responder should classify the incident as a session state condition and not merely a transient API failure. For ERROR_PROFILING_NOT_STARTED, the deciding evidence is start result, target process, profile source, ownership token. Preserving this first-occurrence evidence is more useful than increasing retry frequency for investigation sequence 13.
- Impact boundary: identify the exact process, account, device, file, session, host, or connection affected by this result; do not assume the whole machine is in the same state.
- State change required: the next attempt is justified only after the relevant session state state can differ from the failed attempt.
- Partial outcome: verify whether the operation allocated resources, changed data, sent a request, or modified policy before this result was returned.
- Escalation evidence: preserve start result, target process, profile source, ownership token together with component version and the first preceding failure.
Concrete recovery example
Consider a case where a diagnostic agent skipped the successful-start transition. Repeating the same call leaves the underlying condition unchanged and produces another this result. The durable response is to create a fresh session only after the original start failure is understood. Validation for this Win32 error should use one controlled operation and inspect both the returned status and the resulting state associated with case 13.
Monitoring and validation
A monitoring rule for this Win32 error should distinguish first occurrence from repetition, group events by affected object, and correlate them with deployments or configuration changes. The recovery is complete only when the expected session state state is present and consistent; absence of another log line by itself is not sufficient proof.
Retain the original this result event until validation for investigation case 13 is complete. After it is corrected, verify that no partial or stale artifact specific to remediation sequence 13 remains before declaring recovery complete. This it-specific verification prevents a hidden secondary problem from surviving after remediation step 13.
References
Looking for a different code? Search another status or error code.