What does NTSTATUS 0xC0000009 (STATUS_BAD_INITIAL_STACK) mean?

 
Previous Next
STATUS_INVALID_HANDLE STATUS_BAD_INITIAL_PC

STATUS_BAD_INITIAL_STACK

The new thread stack description was not valid

Native thread creation requires a consistent stack reserve, committed range, stack base, and stack limit. This status indicates that the initial values supplied or constructed for a new thread could not form a valid stack. It is most relevant to low-level runtimes, injectors, emulators, and code that calls native thread-creation interfaces rather than the normal CreateThread wrapper.

A valid memory allocation is not sufficient if the limits are reversed, misaligned, outside the reserved region, or inconsistent with the initial context. Diagnose the producer of the thread state, not the first instruction that failed to execute. If a custom runtime builds a TEB or context manually, compare the values with an equivalent thread created through the supported Win32 API.

What to inspect

  • Record stack base, stack limit, reserve size, commit size, and initial stack pointer.
  • Verify alignment and that every committed page lies inside the reserved stack region.
  • Check whether a native structure layout came from the correct Windows architecture.
  • Prefer supported thread-creation APIs unless the native contract is fully controlled.

References


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