Why can’t 64-bit Windows unwind user-kernel-user exceptions?

I’m the developer who wrote this Hotfix a loooooooong time ago as well as the blog post. The main reason is that the full register file isn’t always captured when you transition into kernel space, for performance reasons.

If you make a normal syscall, the x64 Application Binary Interface (ABI) only requires you to preserve the non-volatile registers (similar to making a normal function call). However, correctly unwinding the exception requires you to have all the registers, so it’s not possible. Basically, this was a choice between perf in a critical scenario (i.e. a scenario that potentially happens thousands of times per second) vs. 100% correctly handling a pathological scenario (a crash).

Bonus Reading

  • Overview of x64 Calling Conventions
  • x86 Software Conventions – Register Usage

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)