| Previous | Next |
| kOSKextReturnKCLoadFailureAuxKC | kIOReturnError |
kIOReturnInvalid
A sentinel, not a device diagnosis
kIOReturnInvalid is unusual among the common IOKit return values: Apple’s public header annotates it as a value that “should never be seen.” It is therefore not a useful description of a normal device, media, permission, or transfer condition. When it reaches application or driver code, the immediate task is to preserve where the value came from rather than to turn it into a generic hardware failure.
Common causes worth investigating are incorrect conversion between signed and unsigned return values, a stale or uninitialised status field, an error mapper that lost the original result, or a component returning a value outside its documented contract. The raw 32-bit value and the API that produced it are more valuable than a later, user-facing text translation.
What to capture
- Log the complete call path, raw hexadecimal value, IOKit family, and the method or selector that returned it.
- Keep the original return value until the diagnostic boundary; do not overwrite it with a generic application error.
- Check the declaration and ABI at every wrapper boundary where
IOReturn,kern_return_t, or integer types are converted. - Compare the result with the implementation’s documented success and error paths before adding a recovery retry.
References
- Apple XNU source: IOReturn.h
- Apple Developer: IOReturn type
- Apple: Introduction to IOKit Fundamentals
Looking for a different code? Search another status or error code.