Introduction to Trap in OS. A trap is a synchronous interrupt triggered by an exception in a user process to execute functionality. Exception conditions like invalid memory access, division by zero, or a breakpoint can trigger a trap in an OS. A trap changes the mode of an OS to a kernel routine.