Consider this:
Application Specific Information:
CoreFoundation: CF objects must have a non-zero isa
You get this crash when you pass something that’s not a CF object to a CF routine that’s expecting a CF object. The backtrace of your crash looks like this:
0 com.apple.CoreFoundation 0x7ff80c885f70 CF_IS_OBJC.cold.1 + 14 …
1 com.apple.CoreFoundation 0x7ff80c7f99b4 CF_IS_OBJC + 60 …
2 com.apple.CoreFoundation 0x7ff80c6c15a8 _CFStringGetCStringPtrInternal + 80 …
3 com.apple.framework.IOKit 0x7ff80fbd30f0 IORegistryEntrySearchCFProperty + 76 …
4 0x10240ff71
Your code, in frame 4, has called IORegistryEntrySearchCFProperty
which is trying to render one of the supplied parameters, probably key
, to a C string. That parameter isn’t a CFString
and so you’ve crashed.
Consider this deliberately bogus test program:
@import Foundation;
@import IOKit;
int main(int argc, char **argv) {
CFStringRef key = (CFStringRef) calloc(1, 1024);
io_registry_entry_t root = IORegistryGetRootEntry(kIOMainPortDefault);
CFTypeRef result = IORegistryEntrySearchCFProperty(
root,
kIOServicePlane,
key,
NULL,
0
);
NSLog(@"result: %@", result);
return EXIT_SUCCESS;
}
On macOS 13 it prints nothing. On macOS 14 it crashes, with a crash report that exactly matches frames 3 through 0 of your crash report. This change of behaviour was deliberate. We added extra hardening to Core Foundation in macOS 14 to catch programming errors like this one.
The lack of symbolication in your crash report makes it hard to tell why your program is passing a bogus object to IORegistryEntrySearchCFProperty
. However, the path forward here is clear: You need to uncover the identity of the code in frame 4 and fix it.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"