Rixstep
 About | Industry Watch | Learning Curve | Products | Purchase | Search | Testimonials
Home » Learning Curve » Developers Workshop

'macOS' Defaults Broken

A tale in pictures.


Buy It

Try It

LONDON (Rixstep) — We became aware of this when preparing to 'track' the latest 'macOS' update.

What we normally do on our test machine is clean everything out (with our own routines and scripts) then 'click' Tracker into action so it leaves a 'timestamp' behind, then archive that time stamp, then let the Apple update do its thing.

Then we can run Tracker after the update and get a total and comprehensive picture of the 'collateral damage'.

But not this time.

Things were worse than expected. Reading the fine print in the Xcode documentation, we learned that a lot is going on behind the scenes with NeXT's justifiably lauded 'defaults' system, things the original architects wouldn't have liked. A lot of CPU cycles, to paraphrase the Bard, for nothing.

For it doesn't help to 'restore' a PLIST file to the Preferences directory after the fact (after a reboot): the system will simply not recognise it.

We actually witnessed this unseen, invisible, code, running behind the scenes, with no visible outward signs of its activity, changing preference files on disk all by itself.


[Yes this is very spooky. Ever worked with a bad compiler? You don't want to. The ground moves under your feet. There's no way to adequately test a compiler: either it ostensibly works or you're SOL. Then you have to scrap it, and get a new one, and try to restore your faith in CompSci. It's not easy. Ed.]

A Simple Test

For the above reasons, Tracker is currently being refactored so it can avoid this disastrous new Apple system altogether.

And that's when we discovered something potentially even scarier.

Working with the current version of Tracker, from last week's update, we note the following.

Note that Apple explicitly discourage users from mucking with their own preferences files these days. And yes, it's starting to reek of 'Windows registry': the whole idea - the big boon, the big advantage - with the defaults system is that users could go in on disk and make corrections when necessary. Today that is no longer necessarily possible. Congrats, Apple. Good job, Sir Tim.

So the steps that follow below will presume an open Terminal window to, at times, issue the all-important command 'defaults delete com.rixstep.Tracker', which is the only way recommended by Apple to clean out (delete) app preferences.

But does it really work? Fasten your seat belts.

  1. Open Terminal. Issue defaults delete command. Do it at least twice until you get this back:

    Domain (com.rixstep.Tracker) not found.
    Defaults have not been changed.

  2. Launch Tracker. Note the 'Stamps' toolbar button. This button can only be enabled if preferences exist on disk and if those preferences include an array of timestamps.

    Is the Stamps button enabled, despite there being no preferences remaining in the system? Yes it is.

  3. Open the Stamps sheet and remove the existing stamp. If you've clicked the 'Go' button, then close that document, open a new one, and remove the stamp from there - Tracker won't remove stamps in use.



    Then verify that the Stamps button is disabled. Then exit Tracker.

  4. Go back to your Terminal window and issue the defaults command again. Twice.

    Domain (com.rixstep.Tracker) not found.
    Defaults have not been changed.

  5. Launch Tracker again. What do you see?

    And just for the fun of it: issue the following command in your Terminal window:

    defaults read com.rixstep.Tracker
    defaults[XXXX:XXXXX]
    Domain com.rixstep.Tracker does not exist

  6. So there are no preferences on disk? Check in ~/Library/Preferences?
    <?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/>
    </plist>
    An empty PLIST. There are no preferences.

  7. Or are there? Care to launch the app again?

Heaven knows what Apple are up to, but, whatever it is, it's not good.

About Rixstep

Stockholm/London-based Rixstep are a constellation of programmers and support staff from Radsoft Laboratories who tired of Windows vulnerabilities, Linux driver issues, and cursing x86 hardware all day long. Rixstep have many years of experience behind their efforts, with teaching and consulting credentials from the likes of British Aerospace, General Electric, Lockheed Martin, Lloyds TSB, SAAB Defence Systems, British Broadcasting Corporation, Barclays Bank, IBM, Microsoft, and Sony/Ericsson.

Rixstep and Radsoft products are or have been in use by Sweden's Royal Mail, Sony/Ericsson, the US Department of Defense, the offices of the US Supreme Court, the Government of Western Australia, the German Federal Police, Verizon Wireless, Los Alamos National Laboratory, Microsoft Corporation, the New York Times, Apple Inc, Oxford University, and hundreds of research institutes around the globe. See here.

All Material and Software © Rixstep All Rights Reserved.

CONTACT INFO:
John Cattelin
Media Contact
contact@rixstep.com

See Also
ACP: Tracker Product Page

About | Industry Watch | Learning Curve | Products | Purchase | Search | Testimonials
Copyright © Rixstep. All rights reserved.