Quantcast
Viewing latest article 10
Browse Latest Browse All 10

Fixing Mac OS X framework errors

Due to a series of unfortunate choices, I accidentally convinced OS X 10.6.8 that it was OS X 10.7. I was mostly able to revert the damage, but sometimes Apple’s Software Update utility will decide to download some 10.7 update and break the a core framework installation, which breaks everything else.

What are the symptoms of such an event? Well, if running almost any application yields a crash with an error that looks like the following, you probably have an inconsistent framework installation.

Process:         vmware [806]
Path:            /Applications/VMware Fusion.app/Contents/MacOS/vmware
Identifier:      com.vmware.fusion
Version:         3.1.3 (416484)
Code Type:       X86 (Native)
Parent Process:  launchd [507]

Date/Time:       2012-04-04 12:32:29.775 -0400
OS Version:      Mac OS X 10.6.8 (10K549)
Report Version:  6

Interval Since Last Report:          7508 sec
Crashes Since Last Report:           15
Per-App Crashes Since Last Report:   4
Anonymous UUID:                      CE0047A5-BFFA-4E13-A739-58AA50C92F0D

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread:  0

Dyld Error Message:
  Symbol not found: __ZN3JSC11JSByteArray10putByIndexEPNS_6JSCellEPNS_9ExecStateEjNS_7JSValueE
  Referenced from: /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore
  Expected in: /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/JavaScriptCore
 in /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore
...

To fix this particular problem, we need to copy over the messed up JavaScriptCore framework with a clean copy. Apple helpfully provides this, in the form of the OS X 10.6.8 combo update. This gigantic package basically contains the all core libraries used by 10.6.8 in a consistent state. The caveat is that simply installing it does not seem to guarantee that these libraries will be used.

Instead, we will manually extract the files from the package using pkgutil and copy them ourselves.

$ pkgutil --expand ./MacOSXUpdCombo10.6.8.pkg ~/combo_update/

If we go into this directory, we will see a bunch of directories with some weird files in them. These are gzipped archives of directories.

$ cd ~/combo_update
$ ls
Distribution				MacOSXUpdCombo10.6.8.Part6.pkg
MacOSXUpdCombo10.6.8.Part0.pkg		MacOSXUpdCombo10.6.8.Part7.pkg
MacOSXUpdCombo10.6.8.Part1.pkg		MacOSXUpdCombo10.6.8.Part8.pkg
MacOSXUpdCombo10.6.8.Part10.pkg		MacOSXUpdCombo10.6.8.Part9.pkg
MacOSXUpdCombo10.6.8.Part11.pkg		QuickTimePlayer7ForCombo10.6.8.pkg
MacOSXUpdCombo10.6.8.Part12.pkg		Resources
MacOSXUpdCombo10.6.8.Part2.pkg		RosettaForCombo10.6.8.pkg
MacOSXUpdCombo10.6.8.Part3.pkg		SUBaseSystemCombo10.6.8.pkg
MacOSXUpdCombo10.6.8.Part4.pkg		X11ForCombo10.6.8.pkg
MacOSXUpdCombo10.6.8.Part5.pkg
$ ls MacOSXUpdCombo10.6.8.Part0.pkg
Bom		PackageInfo	Payload		Scripts

Now, we need to unpack these archives to get to the files we need.

$ mkdir payload
$ cd payload
$ cat ../*.pkg/Payload | gzip -d - | cpio -im

If we look around the payload directory, we can see a familiar Mac OS X directory structure.

$ ls
Applications	System		mach_kernel	sbin
Library		bin		private		usr

Now, we just replace the broken framework with the one from this directory. Warning: The following line REMOVES the existing JavaScriptCore framework, so don’t do it unless you are 100% sure the replacement files were unpacked correctly!

sudo rm -rf /System/Library/Frameworks/JavaScriptCore.framework; sudo cp -R JavaScriptCore.framework /System/Library/Frameworks/

That’s it, your errors should disappear (or at least change). If you are now getting a different framework error, just rinse and repeat with the next affected framework.


Viewing latest article 10
Browse Latest Browse All 10

Trending Articles