Recent Comments

Open Radar FB13723251: UIDropSession.canLoadObjects(ofClass: NSItemProviderReading) not working correctly when using Universal Control in iOS 17

Workaround

For now you can replace these:

session.canLoadObjects(ofClass: aClass)

With:

session.hasItemsConforming(toTypeIdentifiers: aClass.readableTypeIdentifiersForItemProvider)

By victor.pimentel at April 12, 2024, 8:52 a.m.

Open Radar FB13723251: UIDropSession.canLoadObjects(ofClass: NSItemProviderReading) not working correctly when using Universal Control in iOS 17

Info.plist

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <false/> <key>UISceneConfigurations</key> <dict> <key>UIWindowSceneSessionRoleApplication</key> <array> <dict> <key>UISceneConfigurationName</key> <string>Default Configuration</string> <key>UISceneDelegateClassName</key> <string>$(PRODUCT_MODULE_NAME).SceneDelegate</string> <key>UISceneStoryboardFile</key> <string>Main</string> </dict> </array> </dict> </dict> <key>UTExportedTypeDeclarations</key> <array> <dict> <key>UTTypeConformsTo</key> <array> <string>public.composite-content</string> </array> <key>UTTypeDescription</key> <string>Example Document</string> <key>UTTypeIconFiles</key> <array/> <key>UTTypeIdentifier</key> <string>com.example.mydocument</string> <key>UTTypeTagSpecification</key> <dict/> </dict> </array> </dict> </plist>

By victor.pimentel at April 12, 2024, 8:47 a.m.

Open Radar FB13723251: UIDropSession.canLoadObjects(ofClass: NSItemProviderReading) not working correctly when using Universal Control in iOS 17

ViewController.swift

import UIKit

class ViewController: UIViewController, UIDropInteractionDelegate {

override func viewDidLoad() {
    super.viewDidLoad()

    let interaction = UIDropInteraction(delegate: self)
    view.addInteraction(interaction)
}

func dropInteraction(_ interaction: UIDropInteraction, canHandle session: UIDropSession) -> Bool {
    true
}

func dropInteraction(_ interaction: UIDropInteraction, sessionDidUpdate session: UIDropSession) -> UIDropProposal {
    UIDropProposal(operation: .copy)
}

func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession) {
    if session.canLoadObjects(ofClass: ExampleProviderReading.self) {
        print("Can load objects")
        session.loadObjects(ofClass: ExampleProviderReading.self) { containers in
            guard let container = containers.first as? ExampleProviderReading else {
                fatalError("[BUG] Could not load object!")
            }
            print("Loaded an object: \(container)")
        }
    }
}

}

final class ExampleProviderReading: NSObject, NSItemProviderReading { static var readableTypeIdentifiersForItemProvider: [String] { return ["com.example.mydocument"] }

static func object(withItemProviderData data: Data, typeIdentifier: String) throws -> ExampleProviderReading {
    ExampleProviderReading()
}

}

By victor.pimentel at April 12, 2024, 8:45 a.m.

Open Radar 10257191: NSPipe/NSFileHandle file descriptors never freed

SourceTree still broken...

It's April 2024 and I've just seen this error for the first time, using SourceTree 4.2.7 on a Mac OS Sonoma 14.4.1.

By daviddiazgarcia at April 10, 2024, 10:58 a.m.

Open Radar FB13557971: mDNSResponder incorrectly appends search domain to expired CNAME requests with AlwaysAppendSearchDomains

Reply from 'Apple Feedback':

There are changes in the latest update, build 23F5049f, that may have resolved this issue. You can see the software build your device is running and check for the latest update by clicking on the Apple logo in the upper left hand corner > About This Mac. If the build is not visible, click on the macOS version, e.g. 10.15.x, to reveal it.

Has this issue been resolved after installing the latest update? If not, please use Feedback Assistant to let us know you are still experiencing it.

By robertof.public at April 5, 2024, 8:39 a.m.

Open Radar FB13701617: Push Notifications Delivery

nikhil

This is also impacting background notification deliveries for CloudKit running on iOS and macOS.

Open Radar FB13701617: Push Notifications Delivery

nikhil

Upon further inspection:

  • Toggling the WiFi on/off on the device does has no affect.

  • Toggling iCloud Private Relay momentarily works, push notifications arrive, then stop again with the same error.

  • Toggling iCloud Private Relay off again momentarily works.

Furthermore, the apn-unique-id header value in responses cannot be looked up in the Push Notifications console, when the payload is sent to APNS from a script.

Open Radar FB13687535: Environment objects injected on a TabView that contains a NavigationStack never deallocate

Contents of the attached sample project:

@main struct MemoryLeakDemoApp: App { var body: some Scene { WindowGroup { ContentView() } } }

struct ContentView: View {

@State private var showsNavstack = true

var body: some View {
    if showsNavstack {
        LeakyView(isDisplayed: $showsNavstack)
    } else {
        CheckerView()
    }
}

init() {
    #warning("comment this out to exhibit another leak")
    UIApplication.inoculateAgainstSwiftUIEnvironmentMemoryLeakType1
}

}

struct LeakyView: View {

@Binding var isDisplayed: Bool
@StateObject private var canary = Canary()

var body: some View {
    // THIS CAUSES THE LEAKS
    // If the navstack is not embedded in a tab view (directly or indirectly), neither leak gets triggered
    TabView {
        NavigationStack {
            ScrollView {
                VStack(spacing: 16) {
                    Text("Scroll me **up and down**")
                    Button("Then Hide Me") { isDisplayed = false }
                }
                .frame(minHeight: 500)
            }
            // THIS CAUSES ONE OF THE LEAKS – somehow only triggered after scrolling the content a bit
            // However the navbar is also hidden automatically because there's no nav title
            .toolbar(.hidden, for: .navigationBar)
        }
    }
    // THIS LEAKS THE CANARY
    .environmentObject(canary)
}

}

struct CheckerView: View {

@State private var text = ""

var body: some View {
    VStack(spacing: 16) {
        Button("Check Canary") {
            if Canary.instance == nil {
                text = "Canary is dead ✅"
            } else {
                text = "Canary is still alive ❌"
            }
        }
        Text(text)

        Button("Trigger a Workaround") {
            UIApplication.workAroundSwiftUIEnvironmentMemoryLeakType2()
            text = "Check again now ⬆️"
        }
    }
}

}

final class Canary: ObservableObject {

private(set) static weak var instance: Canary?

init() {
    Self.instance = self
}

}

/// As of iOS 13-17.2 (and likely in newer versions too), SwiftUI environment (both values and objects) applied to a TabView that contains a NavigationView/Stack leaks due to being injected into a UIKit trait collection of the underlying navigation controller, which then gets captured by: /// - A UILabel cached globally by UINavigationBar for the purposes of large title label measurement (only if it's the first navigation bar created in the entire app). /// - A pointer interaction's helper view that gets registered with the window by UINavigation but never deregistered. /// Members of this extension work around these leaks. extension UIApplication {

/// This method works around the memory leak caused by the global `UILabel` by creating a dummy navigation bar and triggering a layout pass on it, which forces the label to be created (via function `_UINavigationBarLargeTitleViewLabelForMeasuring`). This prevents navigation bars created _later on_ from capturing the real trait environment, which includes the SwiftUI environment.
///
/// In order to be effective, this method must be called early on in the application lifecycle, before any navigation views are created, but after at least one window scene has been created.
static let inoculateAgainstSwiftUIEnvironmentMemoryLeakType1: Void = {
    guard let scene = shared.windowScene else {
        assertionFailure("Can't work around the memory leak: no window scenes connected")
        return
    }

    let bar = UINavigationBar(frame: CGRect(x: 0, y: 0, width: 320, height: 88))
    bar.prefersLargeTitles = true

    let item = UINavigationItem()
    bar.pushItem(item, animated: false)

    let window = UIWindow(windowScene: scene)
    window.addSubview(bar)

    bar.layoutIfNeeded()

    // The window is removed from the scene automatically as it deallocates
}()

/// This method works around the memory leak caused by a leftover pointer interaction still registered in the window after the navigation bar deallocates.
///
/// Navigation bar creates one or more `_UIPointerInteractionAssistant` (subclass of `UIPointerInteraction`) objects, which are registered with the window. `_UIPointerInteractionAssistantEffectContainerView`, owned by each interaction, is a subview of the navigation bar, and thus captures the trait collection from it. Normally, these interactions get deregistered from the window as the navigation bar goes off-screen, but sometimes they're not, which leaks the SwiftUI environment as the trait collection stored in the view outlives its superview. This is generally triggered by showing/hiding the navigation bar as part of a push/pop.
///
/// In order to avoid unintended side effects, this method must only be called while there's no important UI on the screen.
static func workAroundSwiftUIEnvironmentMemoryLeakType2() {
    for window in shared.windowScene?.windows ?? [] {
        workAroundSwiftUIEnvironmentMemoryLeakType2(in: window)
    }
}

private static func workAroundSwiftUIEnvironmentMemoryLeakType2(in window: UIWindow) {
    // WARNING: THIS IS PRIVATE API
    // UIWindow holds "subtree monitors" – including _UIPointerInteractionAssistant objects (a UIPointerInteraction subclass) – in a nullable NSMutableSet ivar called _subtreeMonitors. It's modified in two methods: _registerSubtreeMonitor and _unregisterSubtreeMonitor. We use the latter to unregister all monitors of the pointer interaction class, thus hopefully removing the only remaining references to them.
    let selector = Selector(("_unregisterSubtreeMonitor:"))
    let ivar = class_getInstanceVariable(UIWindow.self, "_subtreeMonitors")!
    let monitors = object_getIvar(window, ivar) as! NSSet?

    // Remove all monitors of the relevant class
    for case let monitor as UIPointerInteraction in monitors ?? NSSet() {
        window.perform(selector, with: monitor)
    }
}

}

// MARK: - Private extensions

private extension UIApplication {

var windowScene: UIWindowScene? {
    connectedScenes.compactMap { $0 as? UIWindowScene }.first
}

}

By argentumko at March 15, 2024, 4:45 a.m.

Open Radar FB10500605: Write to system register S3_6_C15_C1_5 (aka. SPRR_PERM_EL0 ) in pthread_jit_write_protect_np can fail rarely

It got fixed in macOS 13.0 Beta 3 (22A5295i) and was a race in the process setup by the kernel.

Some hints can be found in a XNU source bump: https://github.com/apple-oss-distributions/xnu/blob/1031c584a5e37aff177559b9f69dbd3c8c3fd30a/bsd/kern/kern_exec.c#L4081-L4099

Open Radar FB12796974: MailKit Extension shows "Loading..." longer than usual esp. for emails with attachments

Aaron

Yep, this is still an issue with 14.3. My last reply from Apple in January about this issue suggested it could be a performance issue with my MEMessageSecurityHandler extension but this definitely happens with Apple's sample extension code.

Open Radar FB9842474: Text does not render negative line spacing values

_lineHeightMultiple is available as an environment key, so environment(._lineHeightMultiple) helps in iOS 17.

Still would love to have an option for negative space

By agapov.one at Feb. 19, 2024, 9:31 a.m.

Open Radar 9106394: Support Ogg Opus in webm container format

There's also a tangential issue where there is no support for VBR Opus whatsoever -- people tend to make them because opusenc makes them by default. As a result, you can't just remux to caf, but you need to also do an actual re-encode in CBR. (FFmpeg will gladly make a CAF with VBR Opus. It just won't play.)

By arthur200126 at Feb. 14, 2024, 1:48 p.m.

Open Radar FB8739821: DiskImages/hdiutil: provide an imagekey to set LZMA compression preset level for ULMO-format disk images

Reply to Apple

This is a less-than-great explanation. Apple Compression library does not have zlib levels, but somehow hdiutil understands zlib-level. For a while your OS even had a /usr/lib/liblzma.dylib, with all the bells and whistles that implies; you could probably bring it back if you really want to.

... Though to be fair, there really isn't too much to gain from just bumping the levels from 6 to 9. Sometimes the miracle lies in changing the pb and other settings (which would a lot of messy imagekeys). Some people even want BCJ for software distribution. That's surprisingly kinda-doable, because ULMO is xz (lzma2) and not legacy lzma, though the extra level of "since <OS version>" is definitely not worth it.

By arthur200126 at Feb. 14, 2024, 1:43 p.m.

Open Radar 22127654: Safari tab reloads/crashes when "Take Photo" option is used with <input type="file">

Still an issue as of 2024

I've tried adding a name attribute per https://stackoverflow.com/questions/29225824/mobile-safari-crashing-while-capturing-photo-using-input-type-file but no luck

By sam.barnum at Feb. 14, 2024, 12:22 a.m.

Open Radar FB12796974: MailKit Extension shows "Loading..." longer than usual esp. for emails with attachments

another MailKit developer

Seems under 14.3 this is still slow.

Note that connectivity issues with either the machine's internet connection, or at the email server level can make this worse (since the responses are even slower); fixing those connectivity issues can help, but large messages (especially those with attachments) will always seem slower since Mail always re-fetches the entire message from the server (instead of using the local cached copy) when any extension is enabled.

By sebastienboisvert at Feb. 13, 2024, 5:18 p.m.

Open Radar FB13453582: macOS 14 Sonoma ikev2 vpn rekey sends invalid proposals, causing a disconnect every 24/48 minutes, error NoProposalChosen

same problem. disconnects every 24 min for me so i can't use it for work anymore after updating to sonoma.

By jcmcnamee at Feb. 9, 2024, 6:52 p.m.