What does macOS kernel return 11 (KERN_ALREADY_IN_SET) mean?

 
Could be also:
ConstantTypeOS
ERROR_BAD_FORMATWin32 errorWindows
ippStsResFloorIntel Ipp StatusAny
EAGAINerrnoLinux
EDEADLKerrnoMac
EAGAINerrnoSolaris
EAGAINerrnoWindows
NO_EXCEPTION_HANDLING_SUPPORTBugCheck CodeWindows
Previous Next
KERN_MEMORY_ERROR KERN_NOT_IN_SET

KERN_ALREADY_IN_SET

KERN_ALREADY_IN_SET is returned when code tries to add a receive right to a port set that already contains it. A Mach port set lets a receiver wait for activity from multiple member ports as one unit; it is not a duplicate list in which adding the same receive right again is meaningful.

This error is usually a lifecycle or state-tracking issue. Setup may run twice, two components may both claim ownership of the same receive right, or cleanup may have failed to reset the local state before initialization repeats. The port itself can still be valid; the conflict is the attempted membership transition.

How to handle it

  • Make port-set registration idempotent only when the existing membership is expected and verified.
  • Track the receive right and the port-set relationship together, not merely the numeric port name.
  • Review concurrent initialization and reconnect paths for duplicate registration.
  • Do not respond by creating another receive right for the same service unless the design explicitly requires one.

Mach port sets are receive-side constructs. The relevant capability is the receive right, which is why a caller with only send rights cannot solve this by re-adding the port.

References


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