| Previous | Next |
| KERN_INVALID_VALUE | KERN_INVALID_CAPABILITY |
KERN_UREFS_OVERFLOW
KERN_UREFS_OVERFLOW reports that an operation would exceed the allowed user-reference count for a Mach port right. A port right is a capability in a task's namespace, and Mach tracks how many user references the task holds to that right.
This is a resource-accounting failure, not an indication that the referenced port is unknown. It usually points to code repeatedly acquiring, copying, or retaining rights without balancing the corresponding release path. Because the counter is associated with a right in one task's namespace, merely looking at the remote service or the port number does not reveal the leak.
Useful investigation steps
- Audit every path that creates, copies, inserts, or receives the affected right.
- Pair those operations with the matching deallocation or destruction behavior required by the API.
- Check error and cancellation paths; they often skip the release that normal completion performs.
- Use ownership-oriented logging rather than retrying the operation, because another acquisition can only worsen the overflow.
The relevant fix is to restore balanced right ownership. Treating this as a transient transport error can hide a steadily growing IPC resource leak.
References
- XNU: kern_return.h
- Apple Kernel Programming Guide: Mach ports and rights
- GNU Mach Reference Manual: Port Manipulation Interface
Looking for a different code? Search another status or error code.
