Why do we need ud2 when int 6 is right there?
Summary
Raymond Chen explains why the ud2 instruction exists as an architecturally undefined instruction and why using int 6 is not a drop-in replacement. He distinguishes between faults and traps, noting how faults report the faulting IP while traps report the next instruction, and discusses protected mode permissions that block user-mode code from invoking int 6. The piece clarifies that to observe a UD fault you need an actual undefined instruction rather than a manual int 6, with implications for debugging and OS/kernel behavior.