What does Windows error code 543 (ERROR_BAD_STACK) mean?

 
Previous Next
ERROR_UNWIND ERROR_INVALID_UNWIND_TARGET

ERROR_BAD_STACK

The stack was invalid during exception unwind

ERROR_BAD_STACK means Windows could not safely walk or unwind the current stack because its structure, alignment, or saved context was invalid. This often reflects memory corruption, an ABI mismatch, or incorrect low-level exception handling.

Likely causes

  • Stack-buffer corruption or an overwritten return address.
  • Calling-convention mismatch across a function boundary.
  • Hand-written assembly with incorrect unwind metadata.
  • Using a damaged context record or switching stacks incorrectly.

Diagnosis

Capture a full dump before continuing. Inspect the exception context, stack limits, unwind metadata, module symbols, and the last trustworthy frames. Enable control-flow protections, compiler stack checks, and Application Verifier where applicable.

Handling

Do not attempt to recover by continuing execution in the corrupted process. Preserve diagnostics and terminate safely. The defect may be exploitable, so prioritize investigation of memory writes preceding the unwind.

Developer note

Validate custom assembly and JIT-generated code against the platform ABI, including required stack alignment and unwind registration.

References


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