| Previous | Next |
| KERN_INVALID_OBJECT | KERN_DEFAULT_SET |
KERN_ALREADY_WAITING
A duplicated wait-state transition
KERN_ALREADY_WAITING identifies a wait-state invariant violation: a thread tried to wait for an event for which it already had a wait registered. This is not equivalent to lock contention or a slow semaphore; it says the state machine has attempted to enter the waiting state twice.
The valuable evidence is the first wait registration. A later call often exposes a missing wakeup, cleanup path, cancellation path, or an incorrectly reused thread/event association.
What to inspect
- Trace the event identifier, thread identity, and call stacks for both wait attempts.
- Follow every path that removes, wakes, cancels, or reuses the wait registration.
- Check whether a callback can re-enter the same wait logic before the first wait completes.
- Check whether an error path skipped the transition that makes the thread eligible to wait again.
References
- Apple XNU: kern_return.h
- Apple Kernel Programming Guide: synchronization primitives
- Apple Kernel Programming Guide: scheduler wait queues
Looking for a different code? Search another status or error code.