M muhahaa Windows Specialist Joined Apr 13, 2013 Posts 30 Aug 28, 2013 #1 Why does WinDbg assume misaligned instruction pointer as a hardware failure instead of stack buffer overflow or other similar software bug?
Why does WinDbg assume misaligned instruction pointer as a hardware failure instead of stack buffer overflow or other similar software bug?
x BlueRobot Administrator Staff member Joined May 7, 2013 Posts 10,252 Location %systemroot% Aug 28, 2013 #2 Do you mean why does it state it as a hardware failure rather than a software bug? This is for data structures, but may be very similar - Data structure alignment - Wikipedia, the free encyclopedia Additional Links: What is "Pointer Alignment" - C / C++ unions, alignment, int pointers, wow! c++ - What exactly is an 'aligned pointer'? - Stack Overflow
Do you mean why does it state it as a hardware failure rather than a software bug? This is for data structures, but may be very similar - Data structure alignment - Wikipedia, the free encyclopedia Additional Links: What is "Pointer Alignment" - C / C++ unions, alignment, int pointers, wow! c++ - What exactly is an 'aligned pointer'? - Stack Overflow
x BlueRobot Administrator Staff member Joined May 7, 2013 Posts 10,252 Location %systemroot% Aug 29, 2013 #3 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. Click to expand... The hardware notifies the operating system of the error. Source: en.wikipedia.org/wiki/Bus_error
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. Click to expand... The hardware notifies the operating system of the error. Source: en.wikipedia.org/wiki/Bus_error
M muhahaa Windows Specialist Joined Apr 13, 2013 Posts 30 Aug 30, 2013 #4 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.
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.
x BlueRobot Administrator Staff member Joined May 7, 2013 Posts 10,252 Location %systemroot% Nov 27, 2013 #5 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.
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.