If a process receives a user note posted from /proc/#/note shortly before itself causes a trap, the trap (NDebug) note gets enqueued in the proc->note array *after* the NUser note and the NUser note gets dequeued and handled while the NDebug is pending. The next switch to kernel (while handling the NUser note) detects the pending NDebug and kills the proc. This patch makes sure the NDebug note gets put in the first slot of the proc->note array giving the user note handler a chance to handle it. This doesnt change any behavior from the manpage. The process still gets killed when trapping while in the note handler.