What does Windows error code 542 (ERROR_UNWIND) mean?

 
Previous Next
ERROR_TIMER_NOT_CANCELED ERROR_BAD_STACK

ERROR_UNWIND

What this result means

ERROR_UNWIND is a Windows system result. Stack unwinding is the process of walking back through active call frames during exception handling, cancellation, or nonlocal control transfer. This code signals that Windows is in or reporting an unwind condition.

Why it can appear

  • an exception handler is being invoked during normal stack unwind
  • code incorrectly treats an unwind notification as a new independent exception
  • a language runtime, injected hook, or manual exception frame violates unwind rules
  • corrupted stack metadata causes the unwinder to enter an abnormal path

Troubleshooting steps

  1. Capture the original exception code, exception flags, instruction pointer, stack pointer, and full stack
  2. Inspect whether the exception record has unwind flags set
  3. Verify compiler, runtime, and module architecture consistency
  4. enable page heap, application verifier, or control-flow diagnostics when stack corruption is suspected

Correct recovery and handling

Do not swallow unwind notifications or resume execution from an invalid frame. Let the language runtime complete cleanup. If custom exception handling is present, follow the platform ABI and keep handlers minimal.

Related and easily confused conditions

This is not itself proof of a crash. It may be an intermediate state during legitimate exception processing. The original exception and the handler that mishandled it are usually more important.

References


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