| Previous | Next |
| STATUS_GUARD_PAGE_VIOLATION | STATUS_BREAKPOINT |
STATUS_DATATYPE_MISALIGNMENT
A data access violated an alignment requirement
This warning-severity exception describes a misaligned data access. Whether the processor can execute the access, whether Windows fixes it up, and whether software sees an exception depends on the architecture and alignment policy. Packed structures, incorrect pointer casts, truncated addresses, and binary data parsed without alignment-aware copies are common causes.
Do not assume that an access working on x86 proves the code is portable. Record the operand width and address modulus, then trace how the pointer was derived. If the data comes from a packed file or network structure, copying into an aligned local object is usually safer than dereferencing a cast pointer. A random-looking address instead suggests broader pointer corruption.
What to inspect
- Determine the required alignment and the actual address used by the instruction.
- Review packed structures, pointer casts, and offsets into serialized buffers.
- Test on the same processor architecture and alignment policy as the failure.
- Use memcpy or explicit decoding when external data is not naturally aligned.
References
- Microsoft Open Specifications: NTSTATUS values
- Microsoft Windows SDK metadata: ntstatus.h
- Microsoft Learn: EXCEPTION_RECORD
- Microsoft Learn: Exception Dispatching
Looking for a different code? Search another status or error code.
