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.

This entry was posted in Software and tagged , .

2 Comments

  1. Jeph
    Posted 2012-07-24 at 17:41 | Permalink

    I used Pacifist to replace my javascriptcore.framework error. Now i’m getting this error:

    ************

    Dyld Error Message:
    Symbol not found: __ZN3JSC14JSGlobalObject12defineGetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectEj
    Referenced from: /System/Library/PrivateFrameworks/JavaScriptGlue.framework/Versions/A/JavaScriptGlue
    Expected in: /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/JavaScriptCore
    **************

    despite replacing the entire javascript folder, it persists. i can’t run any update without getting this error from launching the installer…any ideas?
    email suggestions to :
    partyplanet619@gmail.com

    thx

  2. Posted 2012-08-28 at 19:28 | Permalink

    Sorry, I honestly don’t know. It looks like the JavascriptGlue framework needs to be downgraded to match the JavascriptCore, but I haven’t had to do that on my installation. Good luck, though.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>