What does macOS kernel return 22 (KERN_INVALID_HOST) mean?

 
Could be also:
ConstantTypeOS
ERROR_BAD_COMMANDWin32 errorWindows
ippStsNoIppFunctionFoundIntel Ipp StatusAny
EINVALerrnoAny
CID_HANDLE_CREATIONBugCheck CodeWindows
Previous Next
KERN_RIGHT_EXISTS KERN_MEMORY_PRESENT

KERN_INVALID_HOST

A host-port type mismatch

KERN_INVALID_HOST identifies a mismatch between the interface required by a Mach call and the object represented by the supplied port. Mach uses ports and port rights as references to kernel objects; a port that is valid for one interface is not automatically a host port.

This is different from a machine being offline or unreachable. The operation did not reach a usable host-object interface, so the first question is how the target port was obtained and whether the caller passed a task, thread, processor, security, or ordinary service port in its place.

What to inspect

  • Record the API that produced the port and the API that consumed it.
  • Keep the port type and right provenance in diagnostics rather than only its numeric name.
  • Check whether a wrapper or IPC layer converted a host-related object into a different Mach capability.
  • Compare with KERN_INVALID_SECURITY: that result specifically expects a host security port, not merely a host port.

References


Looking for a different code? Search another status or error code.