Sigh, I really, really hate the fact that OS X requires prebinding for Mach-O applications (which is most now days).
A friend decided to bring over his G3 iMac DV SE (400Mhz) with 192 megs of RAM so I could install Panther on it "the correct way". I wiped the HD (per his request) and installed it. After it was installed, prebinding took up about 1/3rd of the total time to install (maybe a little more, 15-20 minutes). I then installed all the updates that Software update gave me.
Software Update found the following new or updated software:
! ARDClient124Update-1.2.4
Apple Remote Desktop Client, 1.2.4, 832K [required]
! BatteryUpdate-1.1
Battery Update, 1.1, 520K [required] [restart]
! iCal-1.5.2
iCal, 1.5.2, 7852K [required]
! iSync-1.3
iSync, 1.3, 6600K [required]
! iTunes4-4.2
iTunes, 4.2, 6560K [required]
! MacOSXUpdate10.3.2-10.3.2
Mac OS X Update, 10.3.2, 39140K [required] [restart]
! Safari_1.2-1.2
Safari, 1.2, 7860K [required] [restart]
* AirPortSW-3.3
AirPort Software, 3.3, 8752K [restart]
* iPod131-1.3.1
iPod Software, 1.3.1, 5760K
Software Update found the following new or updated software:
! Java142-1.4.2
Java 1.4.2, 1.4.2, 30072K [required] [restart]
! QuickTime65-6.5
QuickTime, 6.5, 18660K [required] [restart]
! SecurityUpd2004-01-26Pan-1.0
Security Update 2004-01-26, 1.0, 8000K [required] [restart]
* BluetoothUpdate1.5-1.5
Bluetooth Software, 1.5, 6212K [restart]
Software Update found the following new or updated software:
! iPod21-2.1
iPod Software, 2.1, 17152K [required]
After each group of updates was installed, software update did the prebinding phase. Each time took about 15 minutes for a total of 45 more minutes (just prebinding).
Zoom to last night at 9:30pm. Went over to the house of a former Teacher of mine to install Panther and to install iLife for him on his 15inch Flat Panel iMac (800Mhz, 256megs RAM). He is on a dial-up connection (that connects at 16800 bps) so using Software Update to download the updates was out of the question. I had asked the other person that was "assisting" me to burn a CD with all the updates we had installed on his iMac the week before. For the life of me I could not trick Software Update into using the files that were on the CD. No matter where I placed them on the HD. I didn't know the order so we just ran Software Update to get the updates it said it could install and then installed those based on modification dates, rebooting when absolutely necessary. (Quick note, you must restart on QuickTime updates, OS X updates and some security updates like the most recent one, if you do not some applications may not launch or will crash on launch.) Because software update wasn't doing the installing, it would prebind all over for every friggin' update. That means each update took 10-45 minutes to install. 10-20 extra minutes of each just to do prebinding. If you look above, that is a LOT of prebinding. Just installing a fraction of the above (QT, Java, Security updates, iMac superdrive update, iLife, Panther, OS X update, Safari, iCal, iSync and ARD) took 4.5 hours to install. 4.5! About 2-2.5 hours of that was JUST PREBINDING! I didn't get home until 2:00am.
Someone tell me who the hell thought a technology that required prebinding would be good? It doesn't speed things up. It doesn't make applications launch faster than in Mac OS 9 or even Classic which use a technology that doesn't require prebinding.
When people are testing the speeds of OS X vs XP, then should also consider the time it takes to install.
I HATE PREBINDING
Update: Forgot about something. It is unwise to launch applications or to start a concurrent install-at all, but especially-when prebinding. If you launch an application when prebinding is happening, there is a chance that it could trash your install (happened twice to me, once by accident, twice to reproduce). "Optimizing" is what Apple calls the prebinding phase in the installer. It isn't actually optimizing anything.
Update 2: I'm posting this here instead of the comments because I think it is a very interesting point that Avi Drissman probably didn't mean to point out to me. Prebinding could be a security risk. Not in of itself, but indirectly. You cannot use the checksum of an executable to determine if it has been modified by another or not on OS X. There are sites dedicated in listing the checksums of files included with different OS version. They are often used when someone believes their machine was hacked or accidently left root logged in. Incidental, yes. Not very important, indeed. But it is one wall that is not there.
Try it:
md5 /bin/mv
MD5 (/bin/mv) = efeb7727e40c597fa33953e551c9979d
Looks fine, no? Well, let us redo the prebinding:
sudo redo_prebinding /bin/mv
md5 /bin/mv
MD5 (/bin/mv) = fe7369c88c3a9220ad803ba3e56bbe06
The checksum has changed. While I am sure that there are better ways to get a checksum none are the answer. And AFAIK, dyld doesn't store the executable's actual checksum anywehere.
Related:
- Hiya Kids, it's Theming Time! - Oct 06, 2009
- Mighty Mouse with Some Theme Sauce - Jun 02, 2009
- WindowShade X 4.3 - Apr 24, 2009
- Sound of the Underground - Apr 20, 2009
- Welcome back. - Apr 17, 2009
The Panther Installer, however, will let you run multiple packages at once and will install them in the order opened, waiting for the previous one to complete before running. That way, at least you can set up a series of installations and then go about other business or pleasure while you wait.
Posted by: Ben Rosenthal on February 24, 2004 3:51 PMDoesn't quite work in practice. I've tried this on my AlBook after its HD died. Killed the login window. Had to reinstall from scratch.
Posted by: Rosyna on February 24, 2004 3:56 PMCirca 10.0 or 10.1 I successfully stubbed out the command-line tool the installer calls to do prebinding with a C tool that just returned 0. This would enable me to do a bunch of installs without waiting for prebinding, and then prebinding just once.
Haven't tried it with 10.2 or later.
Posted by: rentzsch on February 24, 2004 4:25 PMPacifist will let you install without doing the pre-binding step. Or at least it could the last time I used it.
Posted by: Sean on February 24, 2004 6:23 PMTake a look at 10.0 again and recall how life was like before prebinding.
Look, having to prebind after each install of 15 or so is a royal pain in the ass. However, you freely admit you were trying to get around the "correct" way of installing things (for an eminently reasonable purpose, but still). When users install one or two updates as they show up, it's not noticed and the speed benefits *are* noticed day-to-day.
Sorry you had such a rotten evening, and yes, Apple's Installer should have properly chained the installs, but don't fault *prebinding* for all of this mess. Place the blame with Apple's installer where it belongs.
Posted by: on February 24, 2004 11:14 PMNo, it is OS X's fault. Do you remember Mac OS 9? Where was the pain in launching applications there?
These speed benefits don't exist! prebinding is a "solution" to a problem that shouldn't even exist and exists in no other major OS that I know of. Why is that?
Posted by: Rosyna on February 24, 2004 11:26 PM>"Optimizing" is what Apple calls the prebinding phase in the installer.
>It isn't actually optimizing anything.
Prebinding *is* optimizing. It's optimizing the launch time of applications by binding applications to their libraries so they don't have to do it when you actually run them.
Posted by: on February 24, 2004 11:26 PM>Prebinding *is* optimizing. It's optimizing the launch time of
>applications by binding applications to their libraries so they
>don't have to do it when you actually run them.
No, it isn't Optimizing. It is addressing a major flaw in mach-o that shouldn't exist. When it is addressed it is faster than when it isn't addressed, yes.
Posted by: Rosyna on February 24, 2004 11:28 PM>These speed benefits don't exist! prebinding is a "solution" to a
>problem that shouldn't even exist and exists in no other major OS that
>I know of. Why is that?
Okay, is this a serious question or just a rhetorical question? If you really don't know why prebinding exists in Mac OS X, and why it doesn't exist in other OSes, you should read bill bumgarner's explanation:
http://radio.weblogs.com/0100490/stories/2002/08/24/prebindingExplained.html
Posted by: on February 24, 2004 11:28 PMThe question was why don't other OS's have prebinding? Why is OS X the only one (that I am aware of). XP doesn't have it. OS 9 didn't have it. I know exactly what prebinding is and this is another reason I hate it.
Posted by: Rosyna on February 25, 2004 12:15 AM>When people are testing the speeds of OS X vs XP,
> then should also consider the time it takes to install.
You're joking, right? If not, here's your Jello...
Posted by: on February 25, 2004 4:19 AMI spent most of yesterday recovering from the ill effects of doing "other things" while the installer was still prebinding after that last security update. From now on, as soon as the installer starts, I'm stopping.
Sigh.
Posted by: Rob W on February 25, 2004 5:49 AM>The question was why don't other OS's have prebinding?
Presumably because they don't have weak binding. Normally, you link libraries into your executable file on compile time. Or maybe I'm not getting something.
Posted by: on February 25, 2004 7:49 AMRosyna, I'm sometimes astonished that you're a developer, yet so utterly misinformed on issues that one would think are critical to your profession.
Again, prebinding is not at fault (or shall we start discussing why Windows registers DLL's and can take forever mucking with the registry?), but rather the problem is that the installer does not chain installs very well.
Posted by: on February 25, 2004 8:08 AMWhat's with all the anonymous hate? Of course other OSes have weak linking. CFM, for example, resolves all the weak links when the app is launched, and (surprise) manages to do so really quickly. The same holds for ELF binaries. The above-mentioned link describing prebinding doesn't really address the issue of why Mach-O needs this and other formats don't. I do know that Mach-O (until 10.2) didn't have a concept of weak-linking in the same sense that CFM did, so perhaps that is part of it.
Posted by: Brad Oliver on February 25, 2004 11:48 AMPeople are actually bringing prebinding over to other platforms. Search for "ELF prebind" and you find things like:
http://mail-index.netbsd.org/current-users/2002/12/01/0005.html
Posted by: Avi Drissman on February 25, 2004 12:12 PM> CFM, for example, resolves all the weak links when the app is
> launched
I think this is wrong. the code fragment manager resolves weak links when they're actually used, not when the app starts, and I think there's also the difference that with cfm, there's always only one version of a shared library on any Mac. prebinding, otoh, links to the current version of a given version (e.g. a version with the same interface as the version used on compile time) of a library. I think.
although I don't usually program Macs, so I wouldn't be surprised if I were horribly wrong.
http://developer.apple.com/technotes/tn/tn1083.html
Posted by: on February 25, 2004 1:51 PMRe: Security
http://www.periodic-kingdom.org/People/Miro/Papers/
Posted by: Rosyna on February 25, 2004 5:49 PMquote:
"I think this is wrong. the code fragment manager resolves weak links when they're actually used, not when the app starts, and I think there's also the difference that with cfm, there's always only one version of a shared library on any Mac. prebinding, otoh, links to the current version of a given version (e.g. a version with the same interface as the version used on compile time) of a library. I think."
CFM resolves both weak and strong links when the fragment referencing them is loaded. In most cases, this is at application launch time. You can watch the process in the CodeWarrior debugger - the fragment info prints out to the log. The difference being that when a strong link fails to resolve, the application does not launch (or the shared library does not load).
You can have more than one CFM library in the search path. CFM has a well-defined set of rules for determining which shared library to link in. Those rules are published on Apple's web site:
http://developer.apple.com/documentation/mac/runtimehtml/RTArch-21.html
Posted by: Brad Oliver on February 25, 2004 8:57 PMInteresting. This probably means that CFM executables could profit from prebinding, too :-)
I read the link about CFMs ability to differentiate between versions of a library. It doesn't seem to be as powerful as what the Mach-O Runtime Architecture (where the system itself manages several versions of a library or framework) can do, but I don't think the difference explains the difference in speed.
Posted by: on February 26, 2004 12:13 AMPrebinding is sort of trying to reimplement OS 9 behavior on OS X; ie having symbols resolved at start so the costly runtime resolve won't be invoked. (it will be invoked if the prebinding checksum of a particular symbol don't match anylonger however.)
Posted by: Fredrik Andersson on February 26, 2004 9:46 AMAs far as I'm concerned, prebinding has been totally broken ever since 10.2.8--that's when my console and system logs started filling up with 'application X could not be launched prebound, the file changed after the prebinding problem was noted'. Hasn't stopped ever since, and that was after a full reformat and reinstall to move up to Panthro. (No, the -force switch doesn't help.) Strangely, my system still works, and applications launch quickly. But I still have to sit through interminable periods of 'optimizing' after updates.
Posted by: dzd on March 8, 2004 2:11 PMWhen using Mac updates burned from another computer. Remember the invisable files? After you have put the files on your computer you need to: 1. make files that are invisable visiable 2. unlock the D_store in that folder and trash it. That will force your system to create a new D_store file that matches the checksum. Then you'll have the correct hardware fingerprint present in that folder allowing you to execute updates. Believe it or not its a good thing that it won't install untill it gets the hardware id set correctly unless you want a hexdecimal nightmare going which prebinding is useless and would only create a hack missmatch at best.
Posted by: Kcee on November 6, 2006 7:09 AMKeep comments on topic. If a comment is unrelated to this post, it may be removed or moderated.
