To exploit e.g. queue lock to trigger deadlock reliably one should:
1. Rebuild kernel with KDB enabled
2. Make queue lock ever-taken
a. Insert busy loop (DELAY(1000);) in to FIONREAD ioctl handler in between LOCK and UNLOCK invocations (line 374 of before sys/dev/evdev/cdev.c) and rebuild kernel
b. compile and run following snippet. ("/dev/input/event2" is a path to active keyboard evdev device node)
```
#include <sys/ioctl.h>
#include <fcntl.h>
int main() {
int len, fd;
fd = open("/dev/input/event2", O_RDONLY);
while (1) ioctl(fd, FIONREAD, &len);
return (0);
}
```
3. Break to debugger with pressing CTRL+ALT+ESC from console while running 2.b.