Misaligned IP

muhahaa

Windows Specialist
Joined
Apr 13, 2013
Posts
30
Why does WinDbg assume misaligned instruction pointer as a hardware failure instead of stack buffer overflow or other similar software bug?
 
I'm still reading about misaligned pointers, but I think it may be considered a hardware fault (well shown as a hardware fault), because most CPUs can only access parts of memory addresses which have been aligned.

It seems that a alignment fault can also be named a bus error (if I'm correct), which makes even more sense to why it may be considered a hardware fault, as a result of this here:

A segmentation fault (often shortened to segfault), bus error, or access violation is generally an attempt to access memory that the CPU cannot physically address. It occurs when the hardware notifies an operating system about a memory access violation.

The hardware notifies the operating system of the error.

Source: en.wikipedia.org/wiki/Bus_error
 
Misaligned IP: execution in the middle of an instruction, which forms another instruction, which is often invalid: an illegal instruction or illegal memory reference ("segfault"). Sort of like "more cycles" being read as "recycles".

Example: BSOD errors every couple of minutes | AVForums.com - UK Online

The instruction being executed is 1800 (sbb byte ptr [rax],al), which is in fact a part of a longer instruction.

The first thing coming to mind is
stack buffer overflow, a common error in C and C++ programming, but WinDbg assumes hardware.

 
On x86 CPUs, unaligned memory access is corrected and only serves a performance problem, no exception is raised about this. I've also noticed, that the Misaligned IP is only thrown on x64 systems.
 

Has Sysnative Forums helped you? Please consider donating to help us support the site!

Back
Top