1

With Intel x86_64 CPU. I am trying to catch "unaligned memory access fault" on Windows. this works perfectly on Linux (Ubuntu).

For example, I can turn on the AC flag on EFLAGS register like this

    pushfd
    or DWORD PTR[esp], 0x40000
    popfd

Then, misaligned memory access (e.g., DWORD read/write on 0x804a003) raises SIGBUS error for Linux process.

However, with same CPU, if I do the same thing on Windows (7 and 8), nothing happens. can someone explain me why?? is this because Windows disables the CR0.AM flag and Linux does not?

I would appreciate some advises. thank you.

daehee
  • 5,047
  • 7
  • 44
  • 70
  • 2
    Why do you conclude that it doesn't trap on Windows? AFAICT, the CPU traps and Windows ignores the trap. Note that `SIGBUS` isn't the trap itself, but what Linux generates in response to a trap. – MSalters Sep 08 '16 at 14:13

0 Answers0