Post

Replies

Boosts

Views

Activity

Reply to Can't see os_log messages from DriverKit driver
Ok the gremlins are back. I'm not seeing logs anymore, and OSSystemExtensionRequestDelegate is reporting didFailWithError: Request failed. Error Domain=OSSystemExtensionErrorDomain Code=4 "(null)" I'm also seeing the extra zombie driver in System Extensions: $ systemextensionsctl list 2 extension(s) --- com.apple.system_extension.driver_extension enabled active teamID bundleID (version) name [state] UWX5KMH446 com.vocaro.TestApp.driver (1.0/1) com.vocaro.TestApp.driver [terminating for upgrade via delegate] *. * UWX5KMH446 com.vocaro.TestApp.driver (1.0/1) com.vocaro.TestApp.driver [activated enabled] I can get rid of the error if I do systemextensionsctl reset but that only works for two launches. After the second launch, the zombie driver appears, and on the third one, the error starts happening (due to the zombie driver failing to unload, I assume.) At no time do I see any logs. It is so weird... Searching through the Console logs reveals some additional errors that appear to be related to code signing: failed to fetch /Users/trevor/Library/Developer/Xcode/DerivedData/TestApp-feebyyqkhutjwcgetajghxeumarp/Build/Products/Debug/TestApp.app/Contents/Library/SystemExtensions/com.vocaro.TestApp.driver.dext/_CodeSignature/CodeRequirements-1 error=-10 and /Users/trevor/Library/Developer/Xcode/DerivedData/TestApp-feebyyqkhutjwcgetajghxeumarp/Build/Products/Debug/TestApp.app/Contents/Library/SystemExtensions/com.vocaro.TestApp.driver.dext: package type not `SYSX` This issue keeps happening even if I wipe out the Xcode build folder for my project and completely rebuild. It started happening when I switched from a bare-bones driver inheriting from IOService (nearly identical to the Xcode DriverKit template) to one inheriting from IOUserHIDEventService and specifying a ProductID and VendorID (like Apple's HID sample). Strangely, even if I revert to the original code, delete the build folder, clear the system extensions, and reboot, it keeps happening. And still.. no... logs...
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’23
Reply to Can't see os_log messages from DriverKit driver
Aaaaand now I can see logs again. I have no idea why suddenly they're appearing in Console or why they weren't appearing before. Possibly a reboot of my laptop this afternoon (due to an unrelated issue) fixed everything? But I tried that before and it didn't help, so the mystery remains. Strangely, another DriverKit issue I experienced while testing has gone away. During the time when I could not see the log messages, I also noticed that the drivers were not being successfully unloaded and replaced when relaunching the host app (despite returning .replace in actionForReplacingExtension). I would see two entries for the driver in systemextensionsctl reset (one of them in some sort of zombie "waiting for app to terminate" mode, if I remember right). I had to run systemextensionsctl reset to clear them out, otherwise the second launch of the host app would get a didFailWithError with error code OSSystemExtensionErrorExtensionNotFound (4). But I'm not seeing that any more, no matter how many times I relaunch the host app. Gremlins...
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’23
Reply to Can't see os_log messages from DriverKit driver
Ok the gremlins are back. I'm not seeing logs anymore, and OSSystemExtensionRequestDelegate is reporting didFailWithError: Request failed. Error Domain=OSSystemExtensionErrorDomain Code=4 "(null)" I'm also seeing the extra zombie driver in System Extensions: $ systemextensionsctl list 2 extension(s) --- com.apple.system_extension.driver_extension enabled active teamID bundleID (version) name [state] UWX5KMH446 com.vocaro.TestApp.driver (1.0/1) com.vocaro.TestApp.driver [terminating for upgrade via delegate] *. * UWX5KMH446 com.vocaro.TestApp.driver (1.0/1) com.vocaro.TestApp.driver [activated enabled] I can get rid of the error if I do systemextensionsctl reset but that only works for two launches. After the second launch, the zombie driver appears, and on the third one, the error starts happening (due to the zombie driver failing to unload, I assume.) At no time do I see any logs. It is so weird... Searching through the Console logs reveals some additional errors that appear to be related to code signing: failed to fetch /Users/trevor/Library/Developer/Xcode/DerivedData/TestApp-feebyyqkhutjwcgetajghxeumarp/Build/Products/Debug/TestApp.app/Contents/Library/SystemExtensions/com.vocaro.TestApp.driver.dext/_CodeSignature/CodeRequirements-1 error=-10 and /Users/trevor/Library/Developer/Xcode/DerivedData/TestApp-feebyyqkhutjwcgetajghxeumarp/Build/Products/Debug/TestApp.app/Contents/Library/SystemExtensions/com.vocaro.TestApp.driver.dext: package type not `SYSX` This issue keeps happening even if I wipe out the Xcode build folder for my project and completely rebuild. It started happening when I switched from a bare-bones driver inheriting from IOService (nearly identical to the Xcode DriverKit template) to one inheriting from IOUserHIDEventService and specifying a ProductID and VendorID (like Apple's HID sample). Strangely, even if I revert to the original code, delete the build folder, clear the system extensions, and reboot, it keeps happening. And still.. no... logs...
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Can't see os_log messages from DriverKit driver
Aaaaand now I can see logs again. I have no idea why suddenly they're appearing in Console or why they weren't appearing before. Possibly a reboot of my laptop this afternoon (due to an unrelated issue) fixed everything? But I tried that before and it didn't help, so the mystery remains. Strangely, another DriverKit issue I experienced while testing has gone away. During the time when I could not see the log messages, I also noticed that the drivers were not being successfully unloaded and replaced when relaunching the host app (despite returning .replace in actionForReplacingExtension). I would see two entries for the driver in systemextensionsctl reset (one of them in some sort of zombie "waiting for app to terminate" mode, if I remember right). I had to run systemextensionsctl reset to clear them out, otherwise the second launch of the host app would get a didFailWithError with error code OSSystemExtensionErrorExtensionNotFound (4). But I'm not seeing that any more, no matter how many times I relaunch the host app. Gremlins...
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Mar ’23