9 ms·
Apps for which macOS applies compatibillity fixes
- nanoanderson 8y agoVery interesting article, very misleading title.
- userbinator 8y agoMicrosoft Excel/PowerPoint/Word have a patch in _CFArraySortValues to change the sorting algorithm slightly. How do you break sorting?! To take a wild guess, it could be a change from a stable to unstable sort: https://en.wikipedia.org/wiki/Sorting_algorithm#Stability https://en.wikipedia.org/wiki/Sorting_algorithm#Stability Apple gets a bad reputation for their supposed lack of backwards compatibility. Nothing is further from the truth: macOS includes tweaks for specific important apps to keep them working on new OS versions. I read it more as "even Apple is willing to put in patches for backwards compatibility, if your app is important enough." If your app is not, then Apple couldn't care less. MS is more conservative about not breaking things even for relatively obscure apps.
- saagarjha 8y agoMight be. I took a look at _CFArraySortValues, and the "normal" path through it ends up calling CFQSortArray. However, the "com.microsoft.*" path performs what appears to be a bubble sort. Interestingly, the public facing version of CoreFoundation doesn't have the special-case paths: https://github.com/apple/swift-corelibs-foundation/blob/df3ec55fe6c162d590a7653d89ad669c2b9716b1/CoreFoundation/Collections.subproj/CFArray.c#L951 https://github.com/apple/swift-corelibs-foundation/blob/df3e...
- snaily 8y agoI suppose Excel data is often almost sorted with a few new additions, which makes bubble sort an arguably better choice?
- xrisk 8y agoNope, bubble sort always performs the same number of ops regardless of whether the array is partially sorted or not. You might be thinking about insertion sort, which has that feature.
- JoeSmithson 8y agoBubble sort's number of operations can vary from n, if the list is sorted already, up to O(n*n) if the list is reversed.
- umanwizard 8y agoNot true. (3 2 1) -> (2 3 1) -> (2 1 3) -> (1 2 3) (3 passes, 3 swaps) Compare: (1 3 2) - > (1 2 3) (2 passes, 1 swap)
- xrisk 8y agoHmm I suppose you're right. My bad!
- ape4 8y agoIf you write it really poorly that might happen - but its easy to add a check to see if any swaps occurred. If none, you are done.
- kalleboo 8y agoI can't imagine they're using the OS sort for actual spreadsheet data. It's probably for something else like filenames or whatever, and it ends up not finding the file it's expecting in the place it's expecting.
- snaily 8y agoAgreed, especially since I (the GP) thought about this the wrong way - _Apple_ has chosen to use bubble sort as a compatibility measure for some Microsoft apps, not the other way around.
- pducks32 8y agoI believe the open source Swift versions are not supposed to have any check fixes. They are not the ones that are run on Apple OSes and probably never will be. They’re more meant to help Linux and other non Darwin platforms adapt. Which kinda sucks because it means the repos are a little lacking.
- tinus_hn 8y agoWindows also ships with a large number of compatibility fixes (‘shims’) and even has a tool to create your own.
- ridiculous_fish 8y agoI authored many check fixes like these in Cocoa. Cocoa would not change from a stable sort, even if undocumented, to an unstable one. There's large compatibility risk and no benefit, since any app that is bound by sorting speed should do something custom anyways. As to why the sorting hot fix: My first guess is that the app modifies the array from within the comparator. My second guess is that the comparator is not actually transitive, e.g. there can be "less than" cycles. In either case, Cocoa could work around this by employing a naive sorting algorithm.
- beefsack 8y agoThis sounds somewhat analogous to what Nvidia do with their graphics drivers. You hear stories about how the driver is full of game specific hacks to work around bugs / poor designs in the games themselves. While this can be good for performance and stability of these games, it does result in a bloated and complex driver, which I'm certain is difficult to maintain.
- badsectoracula 8y agoYou can confirm these stories by downloading Nvidia Inspector which includes the Nvidia Profile Inspector that allows you to view and edit the - hundreds - game profiles the driver knows about and even make new ones (quite useful if you are playing some obscure game that happens to have a similar bug or use the same engine as a more popular game). The available tweaks even include fixes for games released in the 90s.
- aequitas 8y agoThis imho is how you do this kind of thing. I've seen the contrary to often in production environment where per customer exceptions (if customer-id ==) are made. Instead you have to make the exception itself into a concept en manage the relation between the exception and the customer/application at a different level like nvidea does with the profiles.
- StaticRedux 8y agoIt's easy to write these things off as poor designs in games, and I'm sure some are, but it's also likely that quite a few are creative solutions to solve problems with the provided resources at the time. Those creative solutions probably don't stand the test of time well as new API are created, bug fixes are released, and loopholes that were taken advantage of are closed.
- pier25 8y agoSo what is the reasoning behind Apple's constant breaking changes?
- pier25 8y agoI'm surprised by the downvotes. This was an honest question since Microsoft has been able to move on for years without so many changes.
- grzm 8y agoFrom the article: > "Note that this is just a list of apps Apple has developed compatibility tweaks to make them run on newer macOS versions. As the list demonstrates, even the best apps often needs some tweaks on newer macOS. In addition, most of these patches are only applied to older versions of apps." Quite a stretch from this to the clickbait title "These 299 macOS apps are so buggy...".
- pducks32 8y agoThat’s not fair to say. These apps may very well have done one or two things wrong in their code that required Apple to step in. I have a million such mistakes in my code but no one uses them enough to warrant a checkfix. Also these apps are huge and push the platform forward more than other apps so the likelihood of this relying on undocumented behavior is much much higher and Apple is some sense shares responsibility for those bugs. So the face that they make these checkfixes makes sense.
- gnachman 8y agoI guess I made the big time! The iTerm2 one is interesting because it came too late. Apple's patch disables Sierra's native tabbing. Version 3.1.3 did not disable it completely. I published a fix in version 3.1.4 which came out on October 22, 2017, about a month after Sierra launched. I guess they must have fixed it in a dot release of Sierra, but I won the race and got the fix out before 10.12.1 which came out on October 27. I'm glad someone's got my back, anyway.
- saagarjha 8y agoSpeaking of iTerm's tabbing functionality, are you still using PSMTabBarControl? You make a couple of odd decisions with tabbing, such as blank spot in the tab strip on the right to make way for the overflow indicator, which IMO is inferior to how macOS does it (scrolling tabs). In addition, tab defocusing causes visual discoloration. Does macOS just not provide the API you need, or what?
- masukomi 8y agoi really hate scrolling tabs...
- spronkey 8y agoAgree wholeheartedly. Firefox is basically dead to me because of this (that and it's now trickier than ever to fix it). I'll take 1px wide tabs over scrolling.
- ksec 8y agoUm.... Why? 1px Wide Tab is basically a design that forces people not to have too many tabs. Which is great for those who can keep their Tabs Numbered. But even discounting the number of tabs open to be read, a single Feedly section, or in the old days Google Reader section I could easily bump up to 100+ Tabs, and much more in WWDC / Apple Keynote time. Which makes 1px Tabs annoying as hell. So I really don't understand why 1px Tab is preferred over Scrolling Tabs.
- wallflower 8y agoReminds me of my all-time favorite Joel Spolsky story about Bill Gates' amazing technical free-diving skills and the Excel date compatibility problem. https://www.joelonsoftware.com/2006/06/16/my-first-billg-review/ https://www.joelonsoftware.com/2006/06/16/my-first-billg-rev...
- ggg9990 8y agoIt’s easy to forget that Bill Gates was once the Jeff Dean of his time.
- copperx 8y agoBill Gates is a genius, maybe even in technical stuff, but he wasn't the Jeff Dean of his time.
- ggg9990 8y agoWell of course, in a way, nobody could be, because software didn’t have the impact on the world then as it does now.
- iainmerrick 8y agoI don't think that's entirely fair... It's true that computers and computerisation have never been so ubiquitous as they are now, but they've still been having a big impact for a long time. Off the top of my head, credit cards and ATMs, and the purchase tracking and credit scoring agencies they enabled, have been a big deal since the 60s, says Wikipedia. (I would have guessed later!) Can't do that without a lot of software.
- coldtea 8y agoI'd say it had more impact then. The major impact of software and computing was front-loaded, as in, it came with the early hanging fruits: being able to computerize banking, government data, credit card transactions, international trading, etc. This gave a huge boost to market efficiency and globalization. The rest, with the internet, apps, online sales, etc, is just another outlet for doing business. Whether a 2B2 order happens on the web, or by old-style computer networks, or even by fax, is not that much of a difference.
- robin_reala 8y agoInteresting that Firefox made it onto the list; one would have assumed it would have been easier to produce a patch for an open source application than to maintain a compatibility fix in your own code.
- saagarjha 8y agoWell, who would write the patch? Someone at Apple?
- adrianN 8y agoYes? Or some regular contributor to Firefox that gets guidance from an Apple engineer?
- saagarjha 8y ago> gets guidance from an Apple engineer You do realize that the chances of this happening is next to nil, right? This is doubly true for prerelease software.
- threeseed 8y agoThis happens all of the time. Very common for Apple to reach out to the popular apps. And if you aren't popular you can just goto WWDC where hundreds of engineers will quite happily talk through issues and give guidance on prerelease software.
- saagarjha 8y ago> Very common for Apple to reach out to the popular apps You have to be really popular for this to happen, or be the only adopter of a technology they're trying to push. Basically, the question you have to ask yourself is "could Apple showcase us at a keynote?" Of course, such arrangements have massive NDAs around them. > if you aren't popular you can just goto WWDC where hundreds of engineers will quite happily talk through issues and give guidance on prerelease software Yes, but they aren't going to tell you what's wrong with your software…you'll need to go up to them at tell them "so and so doesn't work" and then they'll help you. I think it's unlikely that they'd just outright tell you that they made a special case for your software and you should get around to fixing it.
- ec109685 8y agoI don’t understand this pseudo code from the article: if __CFAppVersionCheckLessThan("com.microsoft.Powerpoint", CFSystemVersionYosemite) { Why are they comparing an app version to an OS version?
- crooked-v 8y agoIt's comparing what macOS version the app is linked against, not the app's own version number.
- cyberferret 8y agoInteresting. I wonder how much this lookup check adds to every app's load time? I may have missed it in the article, but is the lookup run only upon first time the app is executed, or on every single run instance?
- saagarjha 8y agoIt's done every time app hits a function that requires a workaround. Basically, there are a bunch of calls to _CFAppVersionCheckLessThan sprinkled around Apple's frameworks everywhere. However, the result appears to be cached, so the actual meat of the comparison in the amortized case is a simple lookup.
- jsjohnst 8y ago> I wonder how much this lookup check adds to every app's load time? Based on the IDA disassembly, not much. A few extra CPU instructions has minimal impact generally. > but is the lookup run only upon first time the app is executed, or on every single run instance? It’s done every time the function in question is executed from what I can tell.
- saagarjha 8y ago_CFAppVersionCheckLessThan is called every time, yes, but the result of the check is cached as far as I can tell.
- AceJohnny2 8y ago> [This] function, which returns true if the current app matches the specified bundle ID and is linked on or prior to the macOS version. Thus, older versions of the app would have the fix applied, while newer versions built with a newer SDK would not. This it notable. It means Apple is ensuring backwards compatibility. Even if an updated version of your app (as detected by what OS it linked against) fixes things, these patches are still around for older versions of the app people may still be running. Backwards compatibility never ages out...
- Lorkki 8y agoI agree that there's a sound reason for this, but I can't help but think that API versioning would be the more correct way to do it. This is how you pile up unnecessary complexity.
- macintux 8y agoI’d agree, except what Apple is doing here is orthogonal to backwards compatibility. They’re fixing buggy apps, some of which are buggy because they rely on undocumented behavior.
- rarepostinlurkr 8y agoIf it worked yesterday and after an OS update it still works how is that not backwards compatibility? Does it matter to a user if the change was due to some “buggy apps”? If it works, it works.
- AceJohnny2 8y ago> but I can't help but think that API versioning would be the more correct way to do it I'm not sure what you mean, because to me that's what they're already doing, where the API version maps to the OS version. When compiling in XCode, you can select which OS version you're targeting, and that essentially gives you which API version you're targeting.
- forgotmypw 8y agoMicrosoft does this too, though I can't find the article right now. There are hundreds of special compatibility hacks for various software baked into Windows to make things run smoothly. Edit: The links are broken now, but a paragraph from the article is quoted here: https://www.joelonsoftware.com/2004/06/13/how-microsoft-lost-the-api-war/ https://www.joelonsoftware.com/2004/06/13/how-microsoft-lost... > Look at the scenario from the customer’s standpoint. You bought programs X, Y and Z. You then upgraded to Windows XP. Your computer now crashes randomly, and program Z doesn’t work at all. You’re going to tell your friends, “Don’t upgrade to Windows XP. It crashes randomly, and it’s not compatible with program Z.” Are you going to debug your system to determine that program X is causing the crashes, and that program Z doesn’t work because it is using undocumented window messages? Of course not. You’re going to return the Windows XP box for a refund. (You bought programs X, Y, and Z some months ago. The 30-day return policy no longer applies to them. The only thing you can return is Windows XP.)
- LoSboccacc 8y agowindows hardly changes a function contract. most their patches are to support bugged programs that used the api in undocumented ways, not because they changed an api functionality http://ptgmedia.pearsoncmg.com/images/9780321440303/samplechapter/Chen_bonus_ch01.pdf http://ptgmedia.pearsoncmg.com/images/9780321440303/samplech...
- pieterr 8y ago> The links are broken now https://blogs.msdn.microsoft.com/oldnewthing/20031223-00/?p=41373 https://blogs.msdn.microsoft.com/oldnewthing/20031223-00/?p=...
- ygra 8y agoBack when I looked at the compat fixes in Vista there were about 6000 applications listed there. Granted, a lot of them were games, where the only effect was that they would be added to the (then-new) Games folder. Still, I guess the list has only grown since then.
- Angostura 8y agoI think the thing is that MS is well-known to do this, but I hadn't heard that Apple bothered before.
- saagarjha 8y agoHonestly, I wouldn't be surprised if this is basically the list of apps personally used by Apple employees that broke between releases. EDIT: Here's a list sorted by number of occurrences: https://gist.github.com/saagarjha/f36b6d99c3b89acfc02624806e052462 https://gist.github.com/saagarjha/f36b6d99c3b89acfc02624806e...
- toomanybeersies 8y agoThis used to be Microsoft's shtick, Joel Spolsky wrote an amazing article related to this a few years ago: https://www.joelonsoftware.com/2004/06/13/how-microsoft-lost-the-api-war/ https://www.joelonsoftware.com/2004/06/13/how-microsoft-lost... Relevant excerpt (abridged): > I first heard about this from one of the developers of the hit game SimCity, who told me that there was a critical bug in his application: it used memory right after freeing it, a major no-no that happened to work OK on DOS ... the Windows developers ... added special code that checked if SimCity was running, and if it did, ran the memory allocator in a special mode in which you could still use memory after freeing it.
- xab9 8y ago"I guess Apple’s using the compatibility system to patch other things/change behaviour for specific system apps." Sometimes I do think software is doomed - like when a teammate of mine had to manually edit the bundled and minified javascript files right before release, because the bundler-crawler frankenstein code would've taken another eight hours to finish.
- busterarm 8y agoWell, they can remove those patches for AOL Instant Messenger now, eh?
- raverbashing 8y ago1) (optional) OS vendor release an OS with an API quirk or bug 2) App vendor find out about the bug/issue and works around it, OR uses the API in a weird way that "works" but is non-compliant (see SimCity's use after free) 3) OS fixes the issue but then app breaks 4) Goto 1
- InclinedPlane 8y agoThis is an industry standard practice across many different areas. You know those "game ready" video card drivers you download? Inside the driver there's a big lookup table of executable names tied to tuned parameters for the video pipeline. The APIs that are used (DirectX, OpenGL, etc.) don't allow sufficient tuning of the behavior of GPUs, so instead there's a sort of meta layer of programming which gets done by the graphics card makers.
- Aissen 8y agoAs noted elsewhere in the thread, Microsoft does this as well, and Opera used to do this for broken high-profile websites: https://www.opera.com/docs/browserjs/ https://www.opera.com/docs/browserjs/ Edit: Even Chrome and Safari used to do it: https://dev.opera.com/blog/opera-s-site-patching/ https://dev.opera.com/blog/opera-s-site-patching/
- Lio 8y agoMakes me very happy to see FOSS software like Blender in the list and not just the big commercial applications as I had expected.
- h1d 8y agoMaybe they fix apps whose complaints are louder than average. Putting an effort to make people believe the upgrading on macOS is smooth is important to avoid version spread like on other OS's.
- enzo1982 8y agoApple gets a bad reputation for their supposed lack of backwards compatibility. Nothing is further from the truth. Well, they definitely break a lot of things. Mostly things that were never documented or guaranteed to work, though. My app [1] regularly broke with new macOS releases between 10.9 and 10.12. So often I actually shivered when they announced a new version. I was calling Cocoa stuff from separate threads which is almost never guaranteed to work on macOS (the UI is explicitly not thread-safe). It usually worked on older releases though, but since 10.9 or so, it broke a little more with almost every new release. Not really Apple's fault as it's mosty breaking stuff that was explicitly not guaranteed to work in the first place and which I shouldn't have used. On the other hand, Microsoft seems to keep every quirk from Windows 9x time still working until today. [1] https://github.com/enzo1982/freac https://github.com/enzo1982/freac
- saagarjha 8y ago> I was calling Cocoa stuff from separate threads which is almost never guaranteed to work on macOS (the UI is explicitly not thread-safe) It seems to me that you know what's wrong here, but just in case you don't, most UI work should be done on the main thread. There are certain lower-lever layer APIs that IIRC do explicitly allow for calls from multithreaded contexts, but other than that stick to the main thread. There's actually a new tool, the thread sanitizer, that helps you adhere to this by flagging all misuse of Cocoa outside the main thread.
- i386 8y agoThis is the case for almost every graphical toolkit I’ve developed for.
- nkkollaw 8y agoIf only they put as much care into making sure their new laptop keyboards did't start failing after 2 months, I might still consider spending 2-4 times as much for their hardware..
- amelius 8y ago> Apple gets a bad reputation for their supposed lack of backwards compatibility. Nothing is further from the truth. Yeah, if you have an app that is used by millions of people, that is.
- coldcode 8y agoWhen I was at Apple in the mid-90's with access to the (obviously pre-NeXT) MacOS source code, I was amazed at how many of these version checks were in the code; there were always a lot of Microsoft app/version checks in there.
- gwbas1c 8y agoI work on some Mac applications that, at times, try to exceed what MacOS applications are capable of doing. They almost always break between MacOS releases. Usually the cause is that Apple improved various security restrictions in Gatekeeper. What tends to happen is that older builds work fine, but any new builds don't work well. But, what's interesting is that the page at https://worthdoingbadly.com/assets/blog/appkitcompat/appkit_processed.html https://worthdoingbadly.com/assets/blog/appkitcompat/appkit_... doesn't list any bundle hashes. I always assumed that Apple's hacks for backwards compatibility were tied to the bundle hash, and not the specific application.
- favorited 8y agoSounds like what you're talking about is what's called a "linked-on-or-after" check. That's where they'll see what version of the SDK an app was built against, and enable or disable specific features or bugfixes. Obviously that could be used in conjunction with your app's bundle id.
- gwbas1c 8y agoI used to maintain a Finder plugin that added icon overlays to files, and added menu items to right-click menus. It worked by injecting code into Finder at runtime, and then swapping method implementations for various classes. (Mac developers call this swizzling.) We basically had to reverse engineer Finder every time Apple shipped a new version of MacOS. Later, as the process grew more common, we had to add tricks to make sure that we could work smoothly with other similar plugins. I jumped for joy when Apple released the Finder Extension API!
- _fzslm 8y agoI know you said you don't maintain this plugin anymore, but does it still exist in some form? It sounds interesting!
- gregoriol 8y agoThis is really fucked up: are the app developers made aware of those? (likely not) are they going to experience some "strange" behavior, not like anybody else? if someone at Apple gets aware of a "problem", why not contact the app developers to help fix? It also means that if some other developers want to make an app with the same kind of feature/behavior, they can't? Some app developers also use special bundle IDs for testing... I only see "no-go" reasons for such a thing, not a single valid or positive one!
- ridiculous_fish 8y agoYes, it's common for Apple to report a bug against the app; in fact in many cases the bug has already been fixed in the latest version! But that doesn't help users who are using old versions. Most app developers aren't going to spend resources putting out a dot release for years-old versions of their app. But users use those apps every day. Check-fixed behavior is not a "feature," it's some sub-optimal behavior applied to work around serious bugs. An example is lying to the app about the OS version, to prevent the app from breaking. No developer wants to opt-into such behavior. Note that check-fixes are tied to an SDK version, so when the developer switches to the newest SDK, they'll see the normal behavior.