| Previous | Next |
| MACH_SEND_INVALID_DATA | MACH_SEND_TIMED_OUT |
MACH_SEND_INVALID_DEST
Why this happens
MACH_SEND_INVALID_DEST means that the msgh_remote_port field cannot be used as the destination for this send. A Mach port name is meaningful only inside the calling task’s port-right namespace; a raw integer copied from another task, a deallocated right, a dead name, or a right with the wrong disposition is not a usable destination. A running service may also disappear after the client cached its send right.
This is not the same as an application-level server rejection. The kernel has not delivered a request to the intended service. Treat it as an IPC endpoint or ownership failure and rebuild the request only after rediscovering or re-establishing the destination right.
What to inspect
- Log the destination port name, the
msgh_bitsremote disposition, and the component that supplied the right. - Confirm that the caller still owns a send or send-once right, rather than a receive right, dead name, or stale numeric name.
- For launchd, XPC, or MIG clients, repeat the documented service lookup instead of retaining a port across service restart.
- Do not infer that the request was processed; choose retry behavior from the RPC’s idempotency contract.
References
- Apple Kernel Programming Guide: Mach overview
- Mach Kernel Interface Reference: mach_msg
- Apple XNU source: mach/message.h
Looking for a different code? Search another status or error code.