September 02, 2005
iSync, The Crashes, The Blame Game, and iSWAD (The "Fix")

Might as well join in on the Apple bug reporting Friday fun. Since Tiger's release on April 29th, 2005, we've been receiving quite a few emails about an iSync crash. All of them blaming the crash on APE for some reason or another. This crash is not caused by APE or any APE Module. We've just received so many reports of the crash that, much like the previous Bluetooth Menu Extra bugfix (which was done on a Saturday, not a Friday), I just decided to spend some time and "fix" the darn bug. I mean, we're getting blamed for it anyways. And with that, birth was given to iSyncWorkaroundDealie (iSWAD). I use "fix" in quotes because this workaround is not ideal in any way. Apple should definitely not do anything like this to address the issue. This just prevents the crash from happening so you can use iSync without it crashing.

My first action was, of course, to reduce the bug and report it to Apple. And yes, I did make sure that APE wasn't even installed in the very first crash log I sent. However, the message returned was "remove all haxies and try again". ARG! I had already removed all haxies. I can't remove what's already been removed. So let's just say that I got a little hostile in the bug report. Then RadarWeb did it's lame thing it always does and started being weird. First it'd pretend as if the new crash log I uploaded was successfully uploaded, but it wasn't. Then when I tried to paste it inline, it failed.. but it really didn't fail. All was not lost. The comments on this bug shed light on the real problem, however.

It's actually caused because iSync uses a GCC supported feature called nested functions. When nested functions are used and a CFM library/PEF Binary (the native executable format for the PowerPC) is loaded, all hell breaks loose... basically. Something about loading the CFM runtime causes the stack to just get hosed and it seems iSync crashes the next time CFArrayApplyFunction is called. This usually happens inside of -[ISyncMainWindowController enableDevices:], although in rare circumstances it may happen inside any method call. So this is technically a bug somewhere in Mac OS X, but iSync seems to be the only one that suffers from the problem.

PEF Binaries aren't that unique on OS X. There are quite a few PEF Contextual Menu Modules, QuickTime Plugins, and Scripting Additions being used on OS X as the amount of emails we've received on the problem clearly demonstrates (to us at least). For instance, Adobe Photoshop CS and later requires a scripting addition called "Adobe Unit Types" to function. So if you have Adobe Photoshop CS or later and iSync 2.0 or later the following script will crash (even if you never use iSync):

tell application "iSync"
set blah to current date
synchronize
end tell

Alternatively, iSync will also crash if you have any PEF CMM modules. To test this, open the about box of iSync and right click some text. This loads all the Contextual Menu Modules. If one of the loaded CMMs is a PEF Binary, clicking the Sync button in iSync will cause a crash. Again, you don't have to actually have ever synced any devices to get this crash.

If you want to "prevent" the crash without actually installing APE, you can as long as you don't require the use of Adobe Photoshop CS. Just open the ~/Library/Logs/CrashReporter/iSync.crash.log and search the log for "PEF Binary". Ignore all the lines that start with CFMPriv_ as these are PEF Binaries included with OS X and are loaded to handle the CFM calls. Once you find the name of a PEF Binary, look in Library/Contextual Menu Items/, Library/QuickTime/, and Library/ScriptingAdditions/. The missing slash (/) at the beginning denotes it can be in any Library folder (excluding the /Sytem/Library/ folder, do not touch that one) such as the one at the root of the hard drive, or the one in your user folder. After you remove a specific PEF Binary from the hierarchy, rerun the iSync test and see if it continues to crash, if it does, start from the beginning of this paragraph again.

My first attempt (the source code to it) involved trying to re-implement CFArrayApplyFunction by copying and pasting a lot of the CFArray source code and then trying to find out where it crashed. Luckily, it did not work. It'd stop crashing inside enableDevices: and would then crash in some other random place. So that 8+ hours of trying that approach was a dead end. I wouldn't say it was a waste of time as it taught me to hate the CF code a lot more. Not that I didn't loathe it already.

Then I decided on trying to prevent any CFM Libraries from loading. And that's what actually worked. You can download the "fix" here. It will only load into iSync and won't touch any other processes. The linked disk image contains the source code and the compiled APE module. You'll need to download Application Enhancer to use the APE module (install it in ~/Library/Application Enhancers/) and if you want to compile the project you'll need Xcode 2.1 or later and the APE SDK.

Download iSyncWorkaroundDealie.dmg (72k)

Digg This!

 Posted by rosyna at September 02, 2005 10:08 AM

Trackback Pings:

TrackBack URL for this entry:
http://www.unsanity.org/mt-tb.cgi/335.

Listed below are links to weblogs that reference iSync, The Crashes, The Blame Game, and iSWAD (The "Fix"):

iSync crash with 10.4.4 from jpb's blog
iSync doesn't seem to get along with Fruitmenu on 10.4.4. There's a detailed explanation of just what the problem is here, but going into the Fruitmenu preference pane and setting it to not work with iSync works also. [Read More]

Tracked on January 16, 2006 1:29 PM




Related:
Comments

I'm running 10.4.2 & Adobe Photoshop CS2 - & I am having a big problem with iSync crashing on launch.....
Please excuse me being slow - but are you saying that I will not be able to get iSync to launch if I have Photoshop CS2 installed?
Or, by using your 'fix', I can get iSync to stop crashing?
I installed the latest version of Ape & the 'fix' ape - but iSync stil crashed. Can you please provide an 'idiots' guide' for how to get your 'fix' to work?
Thanks for your help - it is appreciated!

Posted by: zero99 on September 19, 2005 5:34 AM

Running the same here. I am not sure what or where I have to install for the fix?

Thank you!

Larry

Posted by: Larry Winward on September 29, 2005 2:19 PM

You saved me :) I had been unable to sync my nokia 6630 for some months now and I hadn't found any fix (maybe I didn't search well).

Following your suggestions I found the fix, but it's just a bit strange: I found in the crashlog three "PEF Binary" items:

-Component?O0
-CarbonLibpwpc
-Apple;Carbon;Multimedia

The first strange thing is that the "Component" name has in every occurrence in the log different chars appended.

Then I looked in /Library and ~/Library subfolders you suggested and I found just 5 items in /Library/QuickTime/, nothing in all other locations:

-3ivx D4 4.5.1 for OSX
-AC3 Codec.component
-AppleIntermediateCodec.component
-DivX?? 5.component
-ToastVideoCDSupport.component

What I did then was simply move them out of the folder and test the applescript call above, that before had caused iSync to crash, and it didn't... so I started moving back them one by one inside and test each time... and I was able to move ALL of them back in without any crash!

Then I started the sync and it worked!!!

Posted by: Simone Bettini on September 29, 2005 11:57 PM

Thank you for the fix - iSync 2.1 doesnt crash anymore. Hope Apple will fix this problem in 10.4.3.

Thank you!
Michael

Posted by: Michael Klengel on October 18, 2005 5:04 AM

The fix worked great for me on my 12" iBook running 10.4.3. iSync now stops crashing when trying to access features. Thank you very much!

Posted by: voiceoverguy on November 2, 2005 6:26 PM

I want to give you a big kiss for this fix!!! :-)

I have crashing iSync as long as I can think back in different situations!
Crashing at start - crashing at opening About-Box, crashing at starting to sync...
I alway hoped on apple to fix this in the next update - but it never happend.
Also not in the current 10.4.3 update :-(
So I searched again the net for help and now I found your page - and your fix!
Many thanks for it and shame to apple!

Posted by: Andreas Wagner on November 5, 2005 3:36 AM

Interesting, I removed the Flip4Mac Player component, after reading this article, and it instantly fixed my iSync problem.

Posted by: Nathan on January 21, 2006 9:42 AM

Excellent. Now my 3 phone books can be one again.

Posted by: Alfred on February 12, 2006 7:48 PM

I don't use iSync, but my Photoshop CS2 crashes a lot. How do I tell if it is related to this bug?

Posted by: James on February 13, 2006 12:45 PM

Great!!!!!!!!!

4 me it was the "LimitOffsetDH.qtx" in my USER Library/Quicktime folder!
Don`t know why but now its fine again! ThX!
Dan

Posted by: Dan on March 7, 2006 8:44 AM

iSync started crashing on launch after I applied the latest security patch in March. I visited Apple Discussion Groups, but they blamed APE. Then, I googled for 'iSync crash' and found this page. The iSWAD.dmg fixed the iSync crash.

Posted by: Kunio Mitsuma on March 21, 2006 6:44 AM

Hi, i cant seem to download the application enhancer - server error! help.

Posted by: raj on January 25, 2008 2:56 AM
Post a comment
Keep comments on topic. If a comment is unrelated to this post, it may be removed or moderated.





Remember Me?

(you may use HTML tags for style)