3

This error does not crash the app although is concerning. I have been unable to determine why it is occurring although I have figured out that it occurs only whenever I call present(picker, animated: true) where picker is a UIImagePickerController(). I have added all of the necessary permissions to my info.plist and even created a small test app to reproduce this bug.

It does not occur when using any of the simulators and I have only been able to find one other SO post about an error like this, although that post is also unanswered.

The test app I made consists of a simple storyboard with a button to call the UIImagePickerController()present function and then an imageView to accept that photo.

Here is the code for the ViewController.swift:

import UIKit

class ViewController: UIViewController {
    @IBOutlet var imageView: UIImageView!

    override func viewDidLoad() {
        super.viewDidLoad()
    }
    @IBAction func setPicture(_ sender: Any) {
        let picker = UIImagePickerController()
        if UIImagePickerController.isSourceTypeAvailable(.photoLibrary) {
            picker.delegate = self
            picker.sourceType = .photoLibrary
            picker.allowsEditing = true
            present(picker, animated: true)
        }
}
extension ViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {
    func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
        if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage {
           imageView.image = image
        }
        picker.dismiss(animated: true, completion: nil)
    }
    func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
        picker.dismiss(animated: true, completion: nil)
    }
}

I will include the full error I am seeing in the console below:

2021-01-21 09:40:00.160241-0500 Outdoorist[2480:608042] [AXRuntimeCommon] Unknown client: Outdoorist
2021-01-21 09:40:07.259911-0500 Outdoorist[2480:608307] [AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:2483 (
    0   AXRuntime                           0x00000001a3f9eeac 0C4A28F7-3959-3709-8C05-A1A91EED978B + 347820
    1   AXRuntime                           0x00000001a3f4dfb8 _AXGetPortFromCache + 548
    2   AXRuntime                           0x00000001a3f4f610 AXUIElementPerformFencedActionWithValue + 460
    3   UIKit                               0x00000001ce67823c 737C2677-858F-3820-AD45-0EBAABC788BB + 852540
    4   libdispatch.dylib                   0x0000000102e8bce4 _dispatch_call_block_and_release + 24
    5   libdispatch.dylib                   0x0000000102e8d528 _dispatch_client_callout + 16
    6   libdispatch.dylib                   0x0000000102e945ac _dispatch_lane_serial_drain + 748
    7   libdispatch.dylib                   0x0000000102e95234 _dispatch_lane_invoke + 452
    8   libdispatch.dylib                   0x0000000102ea0a5c _dispatch_workloop_worker_thread + 1456
    9   libsystem_pthread.dylib             0x00000001ce3935a4 _pthread_wqthread + 272
    10  libsystem_pthread.dylib             0x00000001ce396874 start_wqthread + 8
)
2021-01-21 09:40:07.260672-0500 Outdoorist[2480:608307] [AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:2483 (
    0   AXRuntime                           0x00000001a3f9eeac 0C4A28F7-3959-3709-8C05-A1A91EED978B + 347820
    1   AXRuntime                           0x00000001a3f4dfb8 _AXGetPortFromCache + 548
    2   AXRuntime                           0x00000001a3f4f610 AXUIElementPerformFencedActionWithValue + 460
    3   UIKit                               0x00000001ce67823c 737C2677-858F-3820-AD45-0EBAABC788BB + 852540
    4   libdispatch.dylib                   0x0000000102e8bce4 _dispatch_call_block_and_release + 24
    5   libdispatch.dylib                   0x0000000102e8d528 _dispatch_client_callout + 16
    6   libdispatch.dylib                   0x0000000102e945ac _dispatch_lane_serial_drain + 748
    7   libdispatch.dylib                   0x0000000102e95234 _dispatch_lane_invoke + 452
    8   libdispatch.dylib                   0x0000000102ea0a5c _dispatch_workloop_worker_thread + 1456
    9   libsystem_pthread.dylib             0x00000001ce3935a4 _pthread_wqthread + 272
    10  libsystem_pthread.dylib             0x00000001ce396874 start_wqthread + 8
)
2021-01-21 09:40:07.261213-0500 Outdoorist[2480:608307] [AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:2483 (
    0   AXRuntime                           0x00000001a3f9eeac 0C4A28F7-3959-3709-8C05-A1A91EED978B + 347820
    1   AXRuntime                           0x00000001a3f4dfb8 _AXGetPortFromCache + 548
    2   AXRuntime                           0x00000001a3f4f610 AXUIElementPerformFencedActionWithValue + 460
    3   UIKit                               0x00000001ce67823c 737C2677-858F-3820-AD45-0EBAABC788BB + 852540
    4   libdispatch.dylib                   0x0000000102e8bce4 _dispatch_call_block_and_release + 24
    5   libdispatch.dylib                   0x0000000102e8d528 _dispatch_client_callout + 16
    6   libdispatch.dylib                   0x0000000102e945ac _dispatch_lane_serial_drain + 748
    7   libdispatch.dylib                   0x0000000102e95234 _dispatch_lane_invoke + 452
    8   libdispatch.dylib                   0x0000000102ea0a5c _dispatch_workloop_worker_thread + 1456
    9   libsystem_pthread.dylib             0x00000001ce3935a4 _pthread_wqthread + 272
    10  libsystem_pthread.dylib             0x00000001ce396874 start_wqthread + 8
)

I would greatly appreciate any assistance with solving this problem or how to avoid it.

I am using Xcode Version 12.3 if that is of any relevance.

Colby Hill
  • 811
  • 1
  • 8
  • 13
  • in your device go to settings -> accessibility and turn off all the accessibility features and check the issue still persist – udi May 03 '23 at 04:41
  • Edit scheme, click on Run, select arguments tab, Under environment variables add this Name: OS_ACTIVITY_MODE, Value: disable – Zain May 07 '23 at 19:39

1 Answers1

2

The problem you describe is reproducible on iOS 16.4.1 and has been around for a long time. It happens regardless of the accessibility configuration of your iPhone. It is a bug in the Operating System, not your code. However it does no harm as such and there is no fix you can do.

The unknown client Outdoorist means merely that the app being run, Outdoorist, is not privileged to (indirectly) talk to the Accessibility Runtime.

The way iOS works (in fact, Darwin based systems of which iOS is an example) is that different processes co-ordinate with each other via the sending of Mach messages. There is security applied at the boundaries between processes because not every process has the "right" to communicate with another on a specific port number.

Specifically here your program is not allowed, via a helper function, to ask the accessibility runtime to perform some action.

The image picker is special; it is sandboxed away from your actual app to mitigate security risks of bad apps reaching private photos of the user. Probably Apple did not configure it correctly in the operating system to collaborate with the Accessibility Runtime.

How do we know this?

In the following explanation, I called my sample app understand-ax-crash because I didn't understand what the problem was at the time. (Actually it is not a crash)

When you pick 'Choose' in the picker you notice the log message, and where it messages from can be set as a breakpoint (by address), and then the steps can be repeated. When 'Choose' is pressed a second time we see the context for where the problem is present.

Debug Session

Here we can see that Thread 4, indirectly kicked off from your app, made the failing request (ax-remoteview-unregister-queue).

It would be the accessibility runtime, servicing the Mach port com.apple.iphone.axserver that refused this request. The breakpoint will just dump the thread backtrace from the place we have stopped execution.

We see the failure in the console.

Mach lookup failure

Looking further up in the disassembly gives details on the steps producing this error.

The only practical thing you can do is to report the issue to Apple.

Faisal Memon
  • 2,711
  • 16
  • 30