Post

Replies

Boosts

Views

Activity

Reply to Incredible huge .xcresult is generated by Xcode 13.2.1 in case of failure
@Quinn, thank you for reply. I tried sudo log erase but it decreases a size of xcresult on about 20%. XCResult still has a ton of system logs attached. Unfortunately, I haven't found options where to disable logs in test plan or test target. Also xcodebuild -help doesn't have options to disable log. I see following in diagnostic logs: 13:18:54.350 xcodebuild[1380:26502] Initiating control session with IDE capabilities: <XCTCapabilities: 0x7fa80b480e70>: { } 13:18:54.351 xcodebuild[1380:26502] XPC connection for control was invalidated. 13:18:54.363 xcodebuild[1380:26502] Got reply to control session initiation request (result:error): <XCTCapabilities: 0x7fa80b2ad320>: { "authorize test session capability" = 1; "initiate daemon control session capability" = 4; "initiate test runner session capability" = 2; "report crashes capability" = 1; "request log archive capability" = 1; "request spindump capability" = 2; }: (null) I tried to dig what's XCTCapabilities but didn't find enough info. Looks like it's some private API. I wonder is any way to configure these capabilities. request log archive capability looks very promising.
Jan ’22
Reply to Incredible huge .xcresult is generated by Xcode 13.2.1 in case of failure
I don’t know. I had a cursory look at this last week and couldn’t find anything that’d be obviously helpful. The next step is to open a > DTS tech support incident and see if our tool specialist can help you out. Not sure If I want to submit DTS since I have only one ticket left. Will it be credited back for this report? As the temporary measure I'm no longer keeping .xcresult bundle, but processing it with https://github.com/XCTestHTMLReport/XCTestHTMLReport into an HTML file. Good choice. Our workaround: save critical data outside .xcresult and delete .xcresult if it greater than 10MB
Jan ’22
Reply to userclient access entitlements for 3rd-party apps
@Drewbadour I added com.apple.developer.driverkit.allow-any-userclient-access into my driver's entitlements and driver is no longer discoverable after re-install. I mean it no longer appears as process, I can't see it in ioreg and can't find a match via IOServiceGetMatchingServices. In Console App I see: taskgated-helper myDriver: Unsatisfied entitlements: com.apple.developer.driverkit.allow-any-userclient-access amfid /Library/SystemExtensions/B7624EEF-3688-4735-A58B-26FEF4DE353C/myDriver.dext/myDriver signature not valid: -67671 I can discover driver if I remove this entitlement but I stuck on IOServiceOpen with kIOReturnError(iokit_common_err(0x2bc) // general error) error. My setup: macOS 12.4 Xcode Version 13.4
Topic: App & System Services SubTopic: Drivers Tags:
Jun ’22
Reply to Cannot communicate with DriverKit extension from macOs App due to IOServiceOpen error
@Drewbadour thank you for quick reply and help! Does the provisioning profile for your dext contain this entitlement? Yes. I see in provision profile: <key>com.apple.developer.driverkit.allow-any-userclient-access</key> <true/> Your driver contains no implementation of ::NewUserClient. This means that it can't accept the UserClient connection. Please make sure to read the documentation around the sample app, implement ::NewUserClient, and ensure that your dext's Info.plist has been appropriately set-up to accept UserClient connections. I'm definitely sure that we tried to add virtual kern_return_t NewUserClient(uint32_t type, IOUserClient** userClient) override; into our Driver. So we added this method and implementation into our Driver and now we see different error - (iokit/common) not permitted. This gave me an idea that Driver is not re-installed/updated sometimes. So we added code to make deactivation request and it looks like now we always have new driver version. Next after reboot and "uninstall first" approach we tested CommunicatingBetweenADriverKitExtensionAndAClientApp again. We can connect to NullDriver and call methods and callback. Unfortunately, we could not connect to NullDriver using our macOS based client and we had same (iokit/common) not permitted. But we can if we set sandbox to false. Next we found temporary exception for iokit: <key>com.apple.security.temporary-exception.iokit-user-client-class</key> <array> <string>IOUserUserClient</string> </array> and now we can connect to NullDriver and our Driver by sand-boxed macOS App. It looks like our issue is solved! Outstanding question how to make sure that new version of driver is installed and run? Should we increase build version for each driver re-install and check what's active by systemextensionsctl list?
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’22
Reply to DriverKit logs not coming into Сonsole App
@eskimo yep. Info and Debug options are enabled in Action. We dug deeper and found that #include <os/log.h> in our Driver is DriverKit/usr/include/os/log.h not macOS's MacOSX.sdk/usr/include/os/log.h. So DriverKit's version has very limited API and declares following macro: #define os_log(log, format, ...) __extension__({ \ os_log_t _log_tmp = (log); \ os_log_type_t _type_tmp = OS_LOG_TYPE_DEFAULT; \ if (os_log_type_enabled(_log_tmp, _type_tmp)) { \ OS_LOG_CALL_WITH_FORMAT(_os_log_impl, \ (&__dso_handle, _log_tmp, _type_tmp), format, ##__VA_ARGS__); \ } \ }) We created a new macro w/o check if (os_log_type_enabled(_log_tmp, _type_tmp)) and now see our logs in Console for kernel process. So it looks like OS_LOG_TYPE_DEFAULT is not enabled. What should we do to enable it?
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’22
Reply to How to do async IO using IOUSBHostPipe?
I think it is more or less your implementation of the ioCompleteCallback function that is missing. It's because we don't know how to read data. Here is method declaration in MyDriver.iig:     virtual void ReadComplete(OSAction *action,                               IOReturn  status,                               uint32_t  actualByteCount,                               uint64_t  completionTimestamp) TYPE(IOUSBHostPipe::CompleteAsyncIO); No data is passed
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’22
Reply to DriverKit: limitations of AsyncCallback in IOConnectCallAsyncStructMethod?
@Drewbadour "Communicating Between a DriverKit Extension and a Client App" shows how to transfer struct synchronously via arguments->structureOutput. However in our case we want to save arguments->completion and transfer data asynchronously when it's provided by USB device. So we have to call AsyncCompletion that has following signature void AsyncCompletion(OSAction *action, IOReturn status, const IOUserClientAsyncArgumentsArray asyncData, uint32_t asyncDataCount, OSDispatchMethod supermethod); where typedef uint64_t IOUserClientAsyncArgumentsArray[16];
Topic: App & System Services SubTopic: Drivers Tags:
Aug ’22