Oriel — AI & technology worth noticing, every day.

Why do we need ud2 when int 6 is right there?

Web page · https://devblogs.microsoft.com/oldnewthing/20261019-00?p=112781%2F

First seen by Oriel on .

AI summary

The post explains why `ud2` is needed to trigger an invalid-opcode fault: `int 6` is a trap with different instruction-pointer semantics and is denied to user-mode programs.

  • A fault reports the address of the faulting instruction, while `int 6` reports the address of the instruction that follows it.
  • Because the #UD handler expects the faulting instruction’s address, using `int 6` can make it inspect a valid next instruction and misidentify the cause.
  • Faults can be retried after repair; traps report completed operations and normally resume at the next instruction.
  • In protected mode, the interrupt descriptor table controls who can explicitly invoke interrupts, and operating systems deny user mode permission to issue `int 6`.
  • Inspecting the faulting instruction can let a handler emulate instructions missing from older processors.

#x86 #cpu exceptions #operating systems

Generated by gpt-5.6-sol. Check the original for details.

Metric trends

Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained

Points

Score reported by the source.

  • Lobsters: 26, latest observation ; +24 over observed period since

Comments

Comment count reported by the source.

  • Lobsters: 0, latest observation ; 0 over observed period since

Aliases

SourceExternal IDURL
Lobsters9u6gm0https://devblogs.microsoft.com/oldnewthing/20261019-00/?p=112781/ Read discussion