What does macOS kernel return 0x10004007 (MACH_RCV_INVALID_NOTIFY) mean?

 
Previous Next
MACH_RCV_PORT_CHANGED MACH_RCV_INVALID_DATA

MACH_RCV_INVALID_NOTIFY

A notification-channel setup error

MACH_RCV_INVALID_NOTIFY occurs when a receive operation requests notification behavior through MACH_RCV_NOTIFY, but the notify argument is not a valid receive right. A send right is not enough: the kernel needs a destination that the caller can receive notification messages from and manage for the duration of the wait.

This result is distinct from MACH_RCV_INVALID_NAME. The receive target may be valid while the secondary notification endpoint is not. Diagnose the two ports separately and do not interpret this as proof that a message was received or that the main port failed.

What to correct

  • Log the receive target and notification port as separate values with their intended right types.
  • Create the notification endpoint before issuing the receive and retain its receive right until completion or cancellation.
  • Audit concurrent cleanup paths that can deallocate or move the notification right.
  • Prefer a higher-level framework’s notification API when it owns the full port-right lifecycle.

References


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